Subject | Re: [firebird-support] Re: How to return a string from a stored procedure? |
---|---|
Author | Mark Rotteveel |
Post date | 2011-09-07T13:44:41Z |
On Wed, 07 Sep 2011 13:08:12 -0000, "firebirdsql" <firebirdsql@...>
wrote:
performing a select which produces multiple rows and assigning it to
something which expects a single row.
assigning it to a variable, so only 1 row is expected. Use RDB$DATABASE as
the table source. If this is an artificial simplification of your problem,
please try to create an SSCCE (see http://sscce.org/ ) which demonstrates
your actual problem.
wrote:
> The problem is that I need to run several SQL statements inside thestored
> procedure that concatenates SQL strings and stores it in a variable. Atthe
> end of the procedure, I just want to return that string.That error message is pretty explicit about your problem: you are
>
> When I do the select from RDB$database at the end, firebird complains
> "multiple rows in singleton select"
performing a select which produces multiple rows and assigning it to
something which expects a single row.
> This is the sql I have:These one or both of these selects produce multiple rows, but you are
>
> SELECT 'test' FROM table1 INTO :var1;
> SELECT 'test2' FROM table2 INTO :var2;
assigning it to a variable, so only 1 row is expected. Use RDB$DATABASE as
the table source. If this is an artificial simplification of your problem,
please try to create an SSCCE (see http://sscce.org/ ) which demonstrates
your actual problem.
> SELECT :var1 || :var2 FROM RDB$DATABASE INTO :return_variable;You don't need to use SUSPEND if you only have one result.
> SUSPEND;