Subject | Re: Multiple rows in singleton select |
---|---|
Author | Adam |
Post date | 2004-12-08T23:49:18Z |
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
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