SQL Error codes from UNIX box

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
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

SQL Error codes from UNIX box

Post by Sreedhar »

Hi,

I am trying to update a field with in the table with some where clause, when the where clause fails.....it gives me an return code of 1 which indicates failure.

If we look something of this sort from Mainframe point of view, we have some thing called as Communication area where in which we get the return code as +100 indicating that the is no record with the given where clause.

Do we have any thing of this sort while writing some script using the Unix box to get the actual SQL error codes rather then just 0 or 1.

If yes how can we achieve that.


Let me know if you need any further information to help you?
Regards,
Shree
785-816-0728
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a reject link from your Enterprise database stage. It will automatically contain the columns from its input link plus a column called sqlcode that will contain the SQL error code returned from the database server.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

Post by Sreedhar »

Hi Ray,

My requirement is that I need to get the SQL code from a unix script.
Regards,
Shree
785-816-0728
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then post your question on a UNIX script forum. DSXchange gives DataStage solutions!

How do you propose to capture the SQL code IN the UNIX script? You can use the exit command to return the value - that part's easy.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply