Page 1 of 1

Add Strings to odacQuery

Posted: Tue 20 May 2008 13:06
by oppofix
Good morning,
i need to execute more than one Update or Insert commands,
using an OdacQuery Object.

If I make:

odacQuery.Add('Update....');
odacQuery.Execute;

with only a single command, it works,
but if i add more than one command:

odacQuery.Add('Update1....');
odacQuery.Add('Update2....');
odacQuery.Add('Update3....');
odacQuery.Execute;

it doesn't work at all.
Have i to add in a certain way every
command text or am i doing something wrong?

Thanks, Fabrizio (Italy)

Try this

Posted: Tue 20 May 2008 19:22
by AlexandreECAD
odacQuery.Append('begin');
odacQuery.Append('Update1.... ;');
odacQuery.Append('Update2.... ;');
odacQuery.Append('Update3.... ;');
odacQuery.Append('end;');
odacQuery.Execute;

Posted: Wed 21 May 2008 06:14
by jfudickar
Or you use the script component.

The OraQuery component only supports single command execution.

Greetings
Jens