Subject Re: [firebird-support] Newbie : Stored procedure to return multiple rows
Author Martijn Tonies
Hi,

> I am trying a test stored procedure with Firebird to see if I can use
> it for development/testing.
> I want to call the procedure and have it return multiple rows from a
> select statement as works with Sybase.
>
> My test example is:
> SET TERM !!;
> CREATE PROCEDURE getnames
> RETURNS (title VARCHAR(10), forename VARCHAR(30), surname
> VARCHAR(30)) AS
> BEGIN
> FOR SELECT title, forename, surname
> FROM name
> INTO :title, :forename, :surname
> DO

SUSPEND;

>>> remove this line > EXIT

> END !!
> SET TERM ;!!
>
> Unfortunately, I get this error:
> Statement failed, SQLCODE = -104
>
> Dynamic SQL Error
> -SQL error code = -104
> -Token unknown - line 9, char 2
> -END

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com