Subject Re: [firebird-support] Re: Multiple rows in singleton select
Author Marcin Bury
Adam

The idea using FIRST would be good but some times the select part returns more
than 1 record (3,4) and it works ok.

It didn't work in this particular case, have worked hundred times for last
several months :-(

Marcin
----- Original Message -----
From: "Adam" <s3057043@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, December 09, 2004 12:49 AM
Subject: [firebird-support] Re: Multiple rows in singleton select


>
>
> Try
>
> INSERT INTO MGP_PROT_REKL_POZ
> SELECT FIRST 1 SRV, GEN_ID(MGP_GEN_PROT_REKL,1),:PR_ID, ID,CAST(0 AS
> INTEGER),CAST('' AS VARCHAR(100))
> FROM MGP_ROLE WHERE SRV = :SRV AND PZ_ID = :PZ_ID AND USZK = 1;
>
> If that doesnt work, convert the select clause into a For select ....
> clause and run your insert from inside that loop.
>
> Firebird may be having an issue with your query if there is the
> potential for the data to return multiple rows. I am not sure how
> intelligent it is when it comes to this sort of thing, but you can
> pretty easily work around it.
>
> Adam
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>