On Fri 04-Apr-2011 15:59 , phil.seay@xxxxxxx wrote:

On my V4R5 machine, the SQL0204 error message for the DROP statement
is thrown as a level 30 error. If I specify ERRLVL(30), I'm not sure
what else that will allow. I checked one of my V5R4 partitions and
found that SQL0204 is thrown as a level 20 error. 8-)


I recall creating a stored procedure once or twice, to resolve that same issue for my scripts. I will post one I just created, in response to a JHHL message, after some testing to see if it is somewhat functional; I would think there should be some examples already on the web, but I did not locate any with some variety of searches.

Apparently until v5r3 where the severity level of -204 for DROP was reduced to 20; or so implied here:
http://forums.systeminetwork.com/isnetforums/showthread.php?t=41179
"in the news group "ibm.software.db2.os400" he asked the same question and Kent Milligan answered:
<i>RUNSQLSTM was enhanced in V5R3 to ignore drop errors when an error level of 20 is specified</i>"

The docs however seems not to have changed until v5r4, so I am not sure about the above claim. The v5r4m0 docs:

Using the SQL statement processor:
"Execution of statements after errors occur"
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/sqlp/rbafyexecutestmt.htm
"If a statement returns an error with a severity higher than the value specified for the error level (ERRLVL) parameter of the Run SQL Statements (RUNSQLSTM) command, the statement fails.

<Start of change>>The rest of the statements in the source are parsed to check for syntax errors, and will not be run. Most SQL errors have a severity of 30. If you want to continue processing after an SQL statement fails, set the ERRLVL parameter of the RUNSQLSTM command to 30 or higher. DROP statements issue a severity level 20 error if the object is not found to be dropped. Setting the ERRLVL parameter to have a value of 20 allows you to ignore these errors for DROP statements while not allowing processing to continue for other higher severity errors.<<End of change>"

Regards, Chuck

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].