Subject | Multiple rows in singleton select |
---|---|
Author | Marcin Bury |
Post date | 2004-12-08T22:53:22Z |
Hello
I have a statement in a stored procedure
INSERT INTO MGP_PROT_REKL_POZ
SELECT 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;
and when executed returns 'multiple rows in singleton select' even if executed
separately. The select part returns only ONE row in this particular case
(accordingly to 'where' parameters values).
What can be the reason - this statement worked hundred of times but returns
error in this case.
Structure of table MGP_PROT_REKL_POZ is
SRV CHAR(3) NOT NULL,
ID INTEGER NOT NULL,
PR_ID INTEGER,
ROLA_ID INTEGER,
USZK_ILE INTEGER,
USZK_OPIS VARCHAR(100)
the result of the select part is:
"PIG";843;842;226417;0;""
I have a statement in a stored procedure
INSERT INTO MGP_PROT_REKL_POZ
SELECT 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;
and when executed returns 'multiple rows in singleton select' even if executed
separately. The select part returns only ONE row in this particular case
(accordingly to 'where' parameters values).
What can be the reason - this statement worked hundred of times but returns
error in this case.
Structure of table MGP_PROT_REKL_POZ is
SRV CHAR(3) NOT NULL,
ID INTEGER NOT NULL,
PR_ID INTEGER,
ROLA_ID INTEGER,
USZK_ILE INTEGER,
USZK_OPIS VARCHAR(100)
the result of the select part is:
"PIG";843;842;226417;0;""