September 15, 2007, 11:08 AM
focuzsambitSQL-Error Cd...
Is there a way to capture the SQL error code in focus files and do the looping accordingly....
sam/wf7.1.6/aix/oracle8i
September 15, 2007, 09:27 PM
FortuneCookieNot sure what you mean by looping accordingly but the code below will provide you with SQL.
SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
SET XRETRIEVAL=OFF
The xretrieval will also allow you run the procedure without actually going to the rdbms to retrieve data.
September 16, 2007, 09:06 AM
Jessica BottoneTry querying either &FOCERRNUM or &RETCODE. I'm not sure you actually need to put these into files. You can, and should, interigate them immediately after your code. For example:
TABLE FILE CAR
PRINT *
ON TABLE HOLD
END
-RUN
-IF &FOCERRNUM NE 0 GOTO ERR_ROUTINE;
-IF &RETCODE NE 0 GOTO ERR_ROUTINE;
And yes, you can GOTO any lable to get yourself out of your loop that you referred to. Just remember you need to check these variables immediately after the code you're interested in because these variables are re-used and will only show you the values for the last commands it executed.