Add Strings to odacQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oppofix
Posts: 5
Joined: Tue 20 May 2008 12:56

Add Strings to odacQuery

Post by oppofix » Tue 20 May 2008 13:06

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)

AlexandreECAD
Posts: 40
Joined: Wed 30 Nov 2005 15:55
Location: Brazil

Try this

Post by AlexandreECAD » Tue 20 May 2008 19:22

odacQuery.Append('begin');
odacQuery.Append('Update1.... ;');
odacQuery.Append('Update2.... ;');
odacQuery.Append('Update3.... ;');
odacQuery.Append('end;');
odacQuery.Execute;

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Wed 21 May 2008 06:14

Or you use the script component.

The OraQuery component only supports single command execution.

Greetings
Jens

Post Reply