...
> I would like to monitor for SQL error messages (and hopefully answer
> them) from a CL.
not possible
> SQLSTATE or SQLCODE, I might as well do it in RPG.
why not ?
. . .
> Even in the RPG, SQLRPGLE, and RGPLE code sources the states are
> mention over and over, but I have yet to see an actuall FULL example
> code where the actual error SR's are shown.
there's no magic there. the SQLCOD and SQLSTT fields are declared
by the precompiler and filled after every executable embedded
SQL statement (i.e. not after declare)
so just
c/Exec Sql
c+ your Sql statement here
c/End-Exec
c if SQLCOD = *zero
* everything ok
c else
* SQLCOD > *zero = warning (e.g. end of file)
* SQLCOD < *zero = error
c endIf
the meaning of the Sql Codes are listet in the manual
hth
Rolf
Which sort of "bad" data ? If there are null data, don't matter monitor
errors; just try
SUBSTR(IFNULL( - - - -, ' '), - , - ) or other combinations.
To monitor SQL errors in HLL programs (Cpbol, RPG, ...) :
EXEC SQL WHENEVER SQLERROR GOTO HANDLER END-EXEC.
or
EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.
or
EXEC SQL WHENEVER NOT FOUND GOTO ENDDATA END-EXEC
Perhaps this could work in an *TXT source for RUNSQLSTM , without EXEC SQL .
I'm not an expert; I just hope this will point you in the right direction.
Seb
<dpr...@bcpl.net> a écrit dans le message news:
8l44iuk9hinuqb1s3...@4ax.com...
ZEXECSQL SQLSTMT('delete from filea where count = 0')
and it would do just that. I've got a V5R1 version in a save file if you
want it. Just let me know and I'll send it to you.
<dpr...@bcpl.net> wrote in message
news:8l44iuk9hinuqb1s3...@4ax.com...