Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 7 of 7 total |
Error 700 missing with clause |
Mon, Feb 27 2012 8:07 PM | Permanent Link |
Colin Wood VirtualTec P/L | My understanding of SQL is rather limited.
If I execute select "TableName","Name","Type", "Length" from information.tablecolumns it runs happily, but if I run Create temporary table InfoTbl as select "TableName","Name","Type", "Length" from information.tablecolumns It wants a “with” clause. I have no idea how to modify it to make it create the temp table. Any help appreciated. |
Mon, Feb 27 2012 8:57 PM | Permanent Link |
Terry Swiers | Colin,
> It wants a “with” clause. You need to specify if you want to just create the empty with the structure of the result set or if you want to populate it too. Add "WITHOUT DATA" to the end of your statement to create the empty table, or "WITH DATA" to populate it. Using your query as an example, Create temporary table InfoTbl as select "TableName","Name","Type", "Length" from information.tablecolumns WITH DATA will get you your temporary table that you can then work with. --------------------------------------- Terry Swiers Millennium Software, Inc. http://www.1000years.com http://www.atrex.com --------------------------------------- |
Mon, Feb 27 2012 9:02 PM | Permanent Link |
Colin Wood VirtualTec P/L | Fantastic, thanks Terry
|
Mon, Feb 27 2012 9:37 PM | Permanent Link |
Colin Wood VirtualTec P/L | Terry, if I want to append the data to an existing table how would I modify the syntax. Obviously "Create temporary" would go, but what do I put in its place?
Create temporary table InfoTbl as select "TableName","Name","Type", "Length" from information.tablecolumns WITH DATA Col |
Tue, Feb 28 2012 12:55 PM | Permanent Link |
Fernando Dias Team Elevate | Colin,
INSERT INTO <YourTempTable> SELECT <Column List> FROM <Your Source Table> -- Fernando Dias [Team Elevate] |
Tue, Feb 28 2012 2:05 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Colin
>Terry, if I want to append the data to an existing table how would I modify the syntax. Obviously "Create temporary" would go, but what do I put in its place? There you'd use an INSERT statement. Treat the temporary table as just another table. eg create temporary table "albert" as select * from contacts with no data insert into albert select * from contacts where _surname like 'w%' select * from albert NOTE these are separate statements run one at a time If you have trouble post what it is you're wanting to insert / update and we'll help you with the sql Roy Lambert [Team Elevate] |
Tue, Feb 28 2012 5:08 PM | Permanent Link |
Colin Wood VirtualTec P/L | Thank you gentlemen, I'll give it a go.
|
This web page was last updated on Tuesday, May 7, 2024 at 02:40 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |