Subject | Re: [firebird-support] SP problem |
---|---|
Author | Nick Upson |
Post date | 2007-10-10T11:44:24Z |
to get a response from "select from mySP ..." you need to add the
suspend command into the SP, at the point you want each row to be
returned, probably within your loop
suspend command into the SP, at the point you want each row to be
returned, probably within your loop
On 10/10/2007, Werner F. Bruhin <werner.bruhin@...> wrote:
> When I do this:
>
> execute procedure t('some text dd', 'wbruhin');
>
> I get the expected result pack, but if I do this:
>
> select trans_value from T('some text dd', 'wbruhin');
>
> I get Null back for trans_value.
>
>
> I must be doing something wrong, but it does not jump at me.
>
> Any hints would be very much appreciated.
> Werner
>
> The SP is:
> CREATE PROCEDURE T (
> orig_value varchar(256),
> user_name varchar(20))
> returns (
> trans_value varchar(256))
> as
> declare variable user_lang varchar(5) character set utf8;
> begin
> /* Procedure Text */
> user_lang = null;
> trans_value = null;
> select lang from i18n_currlang where i18n_currlang.user_name =
> :user_name into :user_lang;
> if (user_lang is not null) then
> begin
> select trans from i18n_trans where i18n_trans.lang = :user_lang
> and i18n_trans.orig = :orig_value into :trans_value;
> if (:trans_value is null) then
> trans_value = :orig_value;
> end
> else
> begin
> trans_value = :orig_value;
> end
> end