Page 1 of 1

Multipe Sql Commands

Posted: Tue Mar 18, 2008 1:40 am
by nkreddy_3
Hello All,

Can we run multiple SQL commands using single close command in Oracle stage.

i.e after the job gets completed one table should be truncated and one more table should gets updated.

Appreciate your help.

Thanks in advance

Karunakar

Posted: Tue Mar 18, 2008 2:00 am
by ArndW
You can always call a stored procedure, which can execute more than one comand.

Posted: Tue Mar 18, 2008 3:18 am
by nkreddy_3
Thanks a lot for your reply.

If I understad correctly we cannot run more than one Sql statement using a single close command in the Oracle stage.

I was succeseed in running a single Sql query in close command but when I am including one more sql by seprating ; in between the job is getting aborted.

Yes we can use stored procedure that option is available but before that t Iam just trying to see whether we can run multiple commands one after one in a single close command.

Please let me know if my understanding is correct.

Thanks,
Karunakar

Posted: Tue Mar 18, 2008 3:27 am
by ArndW
nkreddy3 - that is correct.

Posted: Tue Mar 18, 2008 3:31 am
by nkreddy_3
Thanks for your reply Sir.

Posted: Thu Mar 20, 2008 3:25 am
by admiral1969
You can do it in before sql section this way:
Declare
Begin
SQL statement;
SQL statement;
SQL statement;
...
End;

Posted: Thu Mar 20, 2008 8:01 am
by ray.wurlod
Does the old "double semi-colon" trick (no, that's not the same as a colon) work" ?

Code: Select all

query1;;
query2;;
query3;

Posted: Thu Mar 20, 2008 8:37 am
by DSguru2B
It works in server, we do that currently. I am fairly certain it should work in the OPEN and CLOSE commands as well.

Issue with anonymous block in sql

Posted: Sat Mar 22, 2008 10:17 am
by UPS
The only issue I see with using an anonymous block command is that you are now putting this into sequential mode correct ?
I do not know if that is your desired result.
If so, I know that it works well.