In an sql trigger, I'm trying to implement the ability to add a library
I have the below code...
On the first invocation everything works fine and myLIB gets added to the
But on the second invocation, it still fails with SQLSTATE '38501' because
myLib is in the library list...
I would think when SQLSTATE 38501 is detected it would not fail but
CONTINUE with what is in the BEGIN/END... no? What am I missing?
BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE '38501'
CALL QSYS2.QCMDEXC('RMVLIBLE LIB(myLib)');
CALL QSYS2.QCMDEXC('ADDLIBLE LIB(myLib) POSITION(*LAST)');
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.