on 09-18-2012 4:58 PM
Hi:
I want to make a multiple insert using a Dynamic SQL Script. The code is similar this:
query := 'INSERT INTO "LGARAY"."AUTOMATONS" VALUES (' || :id || ',' || :colValue || ') ' ||
' INSERT INTO "LGARAY"."AUTOMATONS_NEIGHBOUR" VALUES (' || :countNeighbour || ',' || ((:i-1) * :cant) + (:j-1) || ') ' ||
' INSERT INTO "LGARAY"."AUTOMATONS_NEIGHBOUR" VALUES (' || :countNeighbour+1 || ',' || ((:i) * :cant) + (:j-1) || ') ' ||
' INSERT INTO "LGARAY"."AUTOMATONS_NEIGHBOUR" VALUES (' || :countNeighbour+7 || ',' || ((:i+1) * :cant) + (:j+1) || ') ';
EXEC :query;
The problem when I execute this, is seems to be related with SQL sentences in the same line, not supported. I try to use ;, but doesnt works.
I need to execute this, nothing else, not other type of way to do this, I need to test this, so:
Is possible to prepare a STRING with 2 or more queries ?
Thanks!
Hi Leonardo,
I don't think it is possible. Just out of curiosity, why should it be EXACTLY like this and not other type like breaking the query string into individual INSERT statements and executing them in a loop or something.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.