Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 9 of 9 total |
Question about INTO XXX |
Mon, Jul 16 2007 8:53 PM | Permanent Link |
"Tom" | select b.* into "C:\tmp\sss.edb" from billinfo
select b.* into "sss" from billinfo select b.* into "\MEMORY\sss" from billinfo All of sqls raises error ElevateDB Error #700 An error was found in the statement at line 1 and column 17 (Expected FROM but instead found "\.....") select.. into is removed for EDB? |
Tue, Jul 17 2007 1:13 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Tom,
<< select.. into is removed for EDB? >> Yes. It has been replaced by the SQL 2003 standard CREATE TABLE AS: http://www.elevatesoft.com/edb1d7_statements.htm http://www.elevatesoft.com/edb1sql_create_table.htm -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 18 2007 2:58 AM | Permanent Link |
Chris Erdal | "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in
news:AA823ED0-80BF-43D5-85D5-94CFF6235D64@news.elevatesoft.com: ><< select.. into is removed for EDB? >> > > Yes. It has been replaced by the SQL 2003 standard CREATE TABLE AS: > > http://www.elevatesoft.com/edb1d7_statements.htm > http://www.elevatesoft.com/edb1sql_create_table.htm Tim, I just tried out this syntax in the EDB Manager "CREATE TABLE Test3 AS SELECT * FROM Test1 WITHOUT DATA" for a memory database, and got an error: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ======================================================================= SQL Error (ElevateDB 1.04 Build 3) ======================================================================= ElevateDB Error #700 An error was found in the statement at line 1 and column 51 (Expected end of expression but instead found DATA) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The following syntax worked instead: "CREATE TABLE Test3 AS SELECT * FROM Test1 WITHOUT " strange? -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3) |
Wed, Jul 18 2007 3:25 AM | Permanent Link |
Chris Erdal | Chris Erdal <chris@No-Spam-erdal.net> wrote in
news:Xns99715AC78146614torcatis@64.65.248.118: > strange? I was about to complain that it hadn't copied the GENERATED identity column, when I noticed the <LikeDefinition> syntax. This did what I wanted: CREATE TABLE "Test3" (LIKE Test1 INCLUDING GENERATED INCLUDING IDENTITY INCLUDING DEFAULTS) One little thing in the help - your online help page: http://www.elevatesoft.com/edb1sql_create_table.htm doesn't show the brackets following the new tablename as not required if you use the AS SELECT syntax. -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3) |
Wed, Jul 18 2007 12:41 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Chris,
<< I just tried out this syntax in the EDB Manager "CREATE TABLE Test3 AS SELECT * FROM Test1 WITHOUT DATA" for a memory database, and got an error: >> It's a manual error - it should read WITH NO DATA instead. I'll make sure that it is fixed. << The following syntax worked instead: "CREATE TABLE Test3 AS SELECT * FROM Test1 WITHOUT " >> It should issue an error on the trailing token. I'll make sure this is fixed. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 18 2007 12:44 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Chris,
<< doesn't show the brackets following the new tablename as not required if you use the AS SELECT syntax. >> Do you mean parentheses ? If so, then that is correct - the parentheses are optional for the AS syntax: CREATE TABLE MyTable AS (SELECT *....) or CREATE TABLE MyTable AS SELECT *... will both work. This is normal for any query expression. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 18 2007 1:22 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Chris,
<< The following syntax worked instead: "CREATE TABLE Test3 AS SELECT * FROM Test1 WITHOUT " strange? >> Actually, this is correct - EDB is assuming that the WITHOUT token is a correlation name for the Test1 table and part of the SELECT statement. EDB allows you to use reserved words for identifiers provided that they don't conflict with the correct interpretation of the statement. -- Tim Young Elevate Software www.elevatesoft.com |
Thu, Jul 19 2007 12:42 PM | Permanent Link |
Chris Erdal | Tim,
I was doubly unclear: ><< doesn't show the brackets following the new tablename as not >required if > you use the AS SELECT syntax. >> > > Do you mean parentheses ? yes. If so, then that is correct - the > parentheses are optional for the AS syntax: > I was in fact referring to the list of fields in parentheses that follows the CREATEd table's name: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- CREATE [TEMPORARY] TABLE <Name> <<<<<< This part is not allowed if we use AS <QueryExpression> >>>>>> ( <ColumnDefinition>|LIKE <LikeDefinition>|<ConstraintDefinition> [,<ColumnDefinition>|LIKE <LikeDefinition>|<ConstraintDefinition>] ) <<<<<< This part is not allowed - down to here >>>>>> [AS <QueryExpression> [WITH DATA|WITH NO DATA]] [DESCRIPTION <Description>] [VERSION <VersionNumber>] [ENCRYPTED|UNENCRYPTED] [INDEX PAGE SIZE <IndexPageSize>] [BLOB BLOCK SIZE <BLOBBlockSize>] [MAX ROW BUFFER SIZE <MaxRowBufferSize>] [MAX INDEX BUFFER SIZE <MaxIndexBufferSize>] [MAX BLOB BUFFER SIZE <MaxBLOBBufferSize>] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- but I'm not sure of the bracket/brace/other syntax to show that it's a case of: EITHER "parentheses + ColumnDefinition[s]" OR "AS QueryExpression". -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3) |
Thu, Jul 19 2007 5:30 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Chris,
<< I was in fact referring to the list of fields in parentheses that follows the CREATEd table's name: >> Ahh yes. The AS vs. the LIKE, etc. is a mutually-exclusive set of options, so I will make sure to note them as such in the syntax. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |