Subject | Re: [firebird-support] How to assign the result of SELECT to a variable in a procedure |
---|---|
Author | Martijn Tonies |
Post date | 2005-12-02T14:05:14Z |
Hello Peter,
from workers
where ...
into :return_var
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I'm new to FB, hope someone can answer this probably stupid question:select lname
>
> In a stored procedure, I want is to assign the result of a SELECT
> statement to a variable - but can't make it work. I try something like
>
> return_var = select LNAME from WORKERS where WORKERS.ID
> = :proc_parameter;
from workers
where ...
into :return_var
> return_var is of the same type as LNAME - varchar(20)Martijn Tonies
> The select statement itself is correct and works OK in other cases, and
> is guaranteed to return 0 or 1 matches.
> What's the correct way to do this?
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com