Focal Point
SQL-Error Cd...

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7511099642

September 15, 2007, 11:08 AM
focuzsambit
SQL-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
FortuneCookie
Not 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.


Prod: WebFOCUS 7.1.6, Windows 2003

Dev: WebFOCUS 7.6.2, Windows 2003
September 16, 2007, 09:06 AM
Jessica Bottone
Try 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.


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows