Page 1 of 1

Routine getting aborted

Posted: Thu Jan 03, 2013 4:37 pm
by neena
I tried searching the issue but I wasn't able to come up with any info. If I missed please direct me.

When I am running the Job sequencer which is using a user Defined routine, the job sequencer is getting aborted with the Routine warning.

SQLExecDirect STATUS-Select = -1 SQLSTATE= 00000 dbmscode=-1 Error=SQLError rc = 100

This routing is trying to connect to the DB2 and it has some connection details in the code. I was not able to understand it entirely but wondering if you can help me debug the issue.

Code gets started like this

$INCLUDE UNIVERSE.INCLUDE ODBC.H

DEFFUN DSAttachODBCDriver(HDXBC)

EQU ROUTINE_NAME TO "Routine name"
EQU SUCCESS To 0
EQU ERROR To 'ERROR'

Ans = SUCCESS

I tried testing this routine it worked fine in the different region but not works in the production. Both are in the same windows server.

My hunch for the issues is.

1. I am thinking HDXBC is a driver, but I already checked it and I was not able to find any driver with that name. So could it be this driver issue?
2. When it tries to check the routine name and it wasn't able to find it. Could that be the issue?

Really appreciate if any one can point me to right direction.

Thanks.

Posted: Thu Jan 03, 2013 5:41 pm
by chulett
Any chance the table it is reading or the selected result set is empty? A quick search turned up this: SQLError: rc = 100 (SQL_NO_DATA_FOUND)

Posted: Thu Jan 03, 2013 6:00 pm
by neena
That would not be the case. I have ran the query in rapid SQL and it returned the result. I am having this issue with all the routines which are using the Db2 Connection.

Posted: Thu Jan 03, 2013 7:37 pm
by ray.wurlod
-1 is SQL.ERROR therefore the code must iteratively call SQLError() to remove error information from the environment, connection or statement handles until they are clean. In the process of doing so you will learn the true reason for the error code.

Posted: Fri Jan 04, 2013 12:47 pm
by neena
Thanks so much, because of your suggestions I started debugging if it could be the CLI function SQLExecDirect error. Finally we find that we are having ODBC Driver issue. In the advanced tab of the driver we found that for Alternate ID there is no default schema mentioned, after correcting that everything is working fine.

Once again thanks so much for your suggestions