on 02-10-2016 12:57 PM
Hi, I'm tried to do a multi record insert in one simple sql instruccions but doesn't workd
INSERT into TTABLE1
(FIELD1, FIELD2, FIELD3)
values
(VALUE1, VALUE2, VALUE3),
(VALUE21, VALUE22, VALUE23),
(VALUE31, VALUE32, VALUE33),
(VALUE1, VALUE2, VALUE3), (VALUE1, VALUE2, VALUE3), ( (VALUE1, VALUE2, VALUE3),VALUE1, VALUE2, VALUE3),
I get the error poQuery: Error 7200: AQE Error: State = 42000; NativeError = 2117; [iAnywhere Solutions][Advantage SQL Engine]Unexpected token: , -- Expecting semicolon. -- Location of error in the SQL statement is: 184 (line: 4 column: 70).
If I put semicolon get
poQuery: Error 7200: AQE Error: State = 42000; NativeError = 2115; [iAnywhere Solutions][Advantage SQL Engine]Expected lexical element not found: Your statement must start with CREATE, DROP, SELECT, INSERT, UPDATE, ALTER, EXECUTE, DELETE, GRANT, REVOKE, BEGIN, COMMIT, ROLLBACK, SAVEPOINT, SET, DEBUG or a script statement.
If it possible in ADS, do a multi records insert in one sql statement? How?.
Thnks
this is a new feature in ADS 12...with ADS 11 this will not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joachin, I just downloaded the Evaluation version ADS 12 and get the new version of tdataset.exe for delphi and data architect.
In data architect SQL Multiple row insert works well.
I tried this way and works.
But from delphi project i ised TadsQuery this way
And doesn't works. Get error UNEXPECTED TOKEN. , expecting semicolon. Line 4 column 25
But can't be semicolon, must be comma.
What I'm doing wrong?
In AdsQuery Properties says VERSION 12.
I unninstalled Tdataset v12, deleted all references to Library in Delphi IDE, Run a registry cleaner and installed again and begin to works.
But there is something wrong now in my syntax I guess.
I'm filling the adsquery like say before. And at run time get error 7200 Aqe error S0000 native error =2121. Column not found VALUE1
If I put quotes 'VALUE1' Delphi IDE shows syntax error so value cannot be quoted.
If I remove field1 and their values, error halt at VALUE2.
Any idea?
Thanks Joachim
I was missing the QuotedStr.
The error was because my strings values, they are fixed and passed in the sqlstrings. Other values are variable passed by parameters with no problems.
Now works fine. Nice.
I have been using ALS since 9 version, and I see you're improving performance on every update.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.