Subject RE: [firebird-support] SP problem
Author Alan McDonald
> 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


you need to add
SUSPEND;
after setting the trans_value parameter for a select SP
Alan