Subject Re: [firebird-support] How to assign the result of SELECT to a variable in a procedure
Author Martijn Tonies
Hello Peter,

> I'm new to FB, hope someone can answer this probably stupid question:
>
> 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;

select lname
from workers
where ...
into :return_var

> return_var is of the same type as LNAME - varchar(20)
> 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?

Martijn Tonies
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