Page 1 of 1

SQL Error codes from UNIX box

Posted: Thu Jun 07, 2007 12:15 am
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?

Posted: Thu Jun 07, 2007 12:58 am
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.

Posted: Thu Jun 07, 2007 1:48 am
by Sreedhar
Hi Ray,

My requirement is that I need to get the SQL code from a unix script.

Posted: Thu Jun 07, 2007 2:39 am
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.