Subject | Re: [firebird-support] Return value from procedure is NULL |
---|---|
Author | Pavel Menshchikov |
Post date | 2006-11-07T18:47:25Z |
Hello,
s> I have tried to implement procedures in firebird. They are compiled
s> without any problem and i can use them in a select statement. But the
s> result is always NULL.
s> For example this simple procedure:
s> -----------------------------------------------
s> CREATE PROCEDURE TEST
s> returns
s> (
s> result integer
s> )
s> as
s> BEGIN
s> Result = 1;
s> END;
s> -----------------------------------------------
s> I've made an select in this way:
s> select * from TEST;
s> And the result is NULL. When i debugg, the variable is correctly
s> filled.
s> What is going wrong?Do i forget something?
You should understand the difference between selectable and executable
stored procedures. In your case, you created an executable SP, but you
called it as a selectable one. To call an executable SP use EXECUTE
PROCEDURE.
--
Best regards,
Pavel Menshchikov
s> I have tried to implement procedures in firebird. They are compiled
s> without any problem and i can use them in a select statement. But the
s> result is always NULL.
s> For example this simple procedure:
s> -----------------------------------------------
s> CREATE PROCEDURE TEST
s> returns
s> (
s> result integer
s> )
s> as
s> BEGIN
s> Result = 1;
s> END;
s> -----------------------------------------------
s> I've made an select in this way:
s> select * from TEST;
s> And the result is NULL. When i debugg, the variable is correctly
s> filled.
s> What is going wrong?Do i forget something?
You should understand the difference between selectable and executable
stored procedures. In your case, you created an executable SP, but you
called it as a selectable one. To call an executable SP use EXECUTE
PROCEDURE.
--
Best regards,
Pavel Menshchikov