IBM Db2 - The Ultimate Database for Cloud, Analytics & Mobile
I am testing this stored procedure using Db2 11.1 on Windows 10 64-bit.
Informational tokens are "DB2 v11.1.4050.859", "s1911120100",
"DYN1911120100WIN64", and Fix Pack "5".
For NO_DATA_FOUND exception I am getting SQLSTATE = 'ORANF' but in the example below its checking for '02000'.
Is this correct or am I missing something ?
Not sure you got or not. If not,
As DB2 UDB supports SQL Pl and Oracle PL/SQL procedures. First set compatibility to "ORACLE"
1. db2set DB2_COMPATIBILITY_VECTOR=ORA.
2. stop db2 instance db2stop
3. restart db2 instance db2start
4. Inform db2 instance, that your input file is located T below location using the below procedure.
connect to sample;
CALL SYSIBMADM.UTL_DIR.CREATE_OR_REPLACE_DIRECTORY('empdir', 'C:\temp');
and compile your procedure again with
DECLARE CONTINUE HANDLER FOR SQLSTATE 'ORANF' SET SQLSTATE1 = SQLSTATE;
If any questions let me know.
Thank you for your reply.
Well, I sorted this one out a while back just by replacing SQLSTATE '02000' with SQLSTATE 'ORANF' as mentioned in the Version 9.7 example.
I already have DB2_COMPATIBILITY_VECTOR set to 'ORA'.