Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Working multi line sql command in same query



Permlink Replies: 3 - Last Post: Jul 23, 2017 12:11 AM Last Post By: Jeff Overcash (...
Liste Listeler

Posts: 49
Registered: 7/26/07
Working multi line sql command in same query
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 22, 2017 7:11 AM
Hi
I am testing multi sql command in same query but I can not success
for example

Delete from "table1";
Delete from "table2";
Delete from "table3";

and I test
execute block as
begin

Delete from "table1";
Delete from "table2";
Delete from "table3";

end

Hoq can It work in interbase
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Working multi line sql command in same query
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 22, 2017 9:13 PM   in response to: Liste Listeler in response to: Liste Listeler
Liste Listeler wrote:
Hi
I am testing multi sql command in same query but I can not success
for example

Delete from "table1";
Delete from "table2";
Delete from "table3";

and I test
execute block as
begin

Delete from "table1";
Delete from "table2";
Delete from "table3";

end

Hoq can It work in interbase

InterBase has no block command. Either execute them one at a time of use a
component like IBX's IBScript and let it parse and run your multiple commands
for you.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Liste Listeler

Posts: 49
Registered: 7/26/07
Re: Working multi line sql command in same query
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 22, 2017 11:31 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
hi jeff

is there any example for that ?

Jeff Overcash (TeamB) wrote:
Liste Listeler wrote:
Hi
I am testing multi sql command in same query but I can not success
for example

Delete from "table1";
Delete from "table2";
Delete from "table3";

and I test
execute block as
begin

Delete from "table1";
Delete from "table2";
Delete from "table3";

end

Hoq can It work in interbase

InterBase has no block command. Either execute them one at a time of use a
component like IBX's IBScript and let it parse and run your multiple commands
for you.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Working multi line sql command in same query
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2017 12:11 AM   in response to: Liste Listeler in response to: Liste Listeler
Liste Listeler wrote:
hi jeff

is there any example for that ?

Jeff Overcash (TeamB) wrote:
Liste Listeler wrote:
Hi
I am testing multi sql command in same query but I can not success
for example

Delete from "table1";
Delete from "table2";
Delete from "table3";

and I test
execute block as
begin

Delete from "table1";
Delete from "table2";
Delete from "table3";

end

Hoq can It work in interbase
InterBase has no block command. Either execute them one at a time of use a
component like IBX's IBScript and let it parse and run your multiple commands
for you.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Fairly straight forward, just add your SQL statements to the IBScript separated
by commas, then call ExecuteScript. You add lines just like you would any
TStringList.

Several events like OnError to deal with Errors, or you can test parse it to
make sure your script parses right with the OnParse event etc, but the basics
are very straight forward.

I haven't updated this in a long while, but here is the first demo for IBScript

https://cc.embarcadero.com/Item/17110

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02