Subject | Re: [ib-support] Returning SQLCODE |
---|---|
Author | Ivan Prenosil |
Post date | 2001-06-12T10:49:45Z |
> How can I have a stored procedure returning SQLCODEIf you do not need to handle exceptions inside SP (like in your example)
> in case of an exception (ANY) inside its code back to
> Delphi, using a TIBStoredProc?
>
> Is something like the following possible?
>
> CREATE PROCEDURE MyTableInsert ( AName VARCHAR(40) )
> RETURNS ( RESULT INTEGER )
> AS
> BEGIN
> INSERT INTO MyTable(F_NAME) VALUES ('Delphi');
> RESULT = 0; /* no error */
> WHEN ANY DO
> BEGIN
> RESULT = SQLCODE;
> END
> END ^
just do not trap them (i.e. do not use WHEN ANY DO).
Possible errors/exceptions will be reported back to client software
through status vector
(iirc in Delphi components there should be OnError event with SQLCODE parameter).
Ivan
prenosil@...
http://www.volny.cz/iprenosil/interbase