Quote:
Originally Posted by surjyakp
Hi,
But when I execute it through store procedure like below , it returns multiple row.
DECLARE USERID INTEGER DEFAULT 0;
SET USERID=(select pq5.incdnt_all.usrid from pq5.incdnt_all where pq5.incdnt_all.incdnt_id = Incdnt_ID);
|
Your subselect is equivalent to
Code:
select pq5.incdnt_all.usrid from pq5.incdnt_all where 1 = 1
which obviously returns all rows in the table. You should use some kind of naming convention that distinguishes table column names from variable and parameter names.