Subject Re: Stored procedure return_value always null
Author flipmooooo
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@y...>
wrote:
>
> Yes, it returns an exception
>
> Your main SP can handle (swallow or re-raise) that exception if
you
> like. The same way that delphi and I'm sure many other languages
> handle them.
>
> Adam

Hi,

U don't understand i think. I need the EXACT messagetext which
occurred in SP2 in SP1 to insert in a log. I can't insert in the log
in SP2 because all changes will b undone by the triggered exception.

SP1
begin
FOR
SELECT LYDCID
FROM LYDOC
WHERE
LYDCBKJ = :BOEKJAAR AND
LYDCACCEPTED = 0
ORDER BY LYDCDGB,LYDCDOCNR
INTO :AID
DO
BEGIN
...
EXECUTE SP2
WHEN EXCEPTION INVALID_ENTRY DO
BEGIN
ERRORCOUNT = ERRORCOUNT + 1;
INSERT INTO TMPLOG
(...,TMPLOEXCEPTION_NAME,TMPLOEXCEPTION_MSG)
VALUES
(...,'INVALID_ENTRY','TABLENAME;'||CAST(ID as VARCHAR(9))); <---
END
end

SP2
begin
...
If SOME_TEST_FAILED then
EXCEPTION INVALID_ENTRY 'TABLENAME;'||CAST(ID as VARCHAR(9)); <---
...
end