Multipe Sql Commands

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nkreddy_3

Multipe Sql Commands

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can always call a stored procedure, which can execute more than one comand.
nkreddy_3

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

nkreddy3 - that is correct.
nkreddy_3

Post by nkreddy_3 »

Thanks for your reply Sir.
admiral1969
Participant
Posts: 10
Joined: Wed Feb 27, 2008 3:37 am

Post by admiral1969 »

You can do it in before sql section this way:
Declare
Begin
SQL statement;
SQL statement;
SQL statement;
...
End;
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
UPS
Premium Member
Premium Member
Posts: 56
Joined: Tue Oct 10, 2006 12:18 pm
Location: New Jersey

Issue with anonymous block in sql

Post 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.
Post Reply