Troubleshooting
Problem
SELECT-INTO statement in a Store Procedure returns SQLCODE -438 instead of +100 when resultset is empty
Symptom
This problem only happens when the database is created with Oracle compatibility. It usually happens in a Store Procedure, when a SELECT-INTO statement returns empty result, SQLCODE would be set to -438:
------------------------------------------------------------
BEGIN
SELECT COL2
INTO VCOL1
FROM TEST
WHERE COL1=100;--
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_SQL_CODE := TO_CHAR(SQLCODE);--
END;--
------------------------------------------------------------
In above simple code, when the SELECT-INTO statement returns empty result, SQLCODE is set to -438. So, the user may receive following error when call the procedure:
SQL0438N Application raised error or warning with diagnostic text: "".
SQLSTATE=45000
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
01 May 2025
UID
swg21689836