Hi Gang,
I needed a way for the SQL programmers to pass custom error message
back to the tier1 clients through tier2 (ODBC,JDBC bridge). The
enclosed code example works fine in Informix's SQL Editor but when I
attempt to issue the raise exception from a call initiated from tier2
(ODBC) the exception is not passed back. The ODBC driver does not
report any type of error!
Anyone know how to get this to work?
(Informix 7.3, Java 1.1.5 & Informix ODBC via Intersolv)
---CODE---
CREATE PROCEDURE cu_errorexample ( P_NetID varchar(254) )
RETURNING varchar(40);
DEFINE rName varchar(40);
select name into rName from personal_data A where
A.emplid = cu_NetID2EmplID( P_NetID );
IF rName is NULL THEN
{
The user does not exists so we are going to complain.
We will raise and exception along with an error message to tell the
client what is going on.
smb1, 1998.09.08
}
RAISE EXCEPTION -746,0,'This fool does not exist in
the DB mon!';
END IF;
RETURN rName;
END PROCEDURE;
---CODE---