By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,276 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,276 IT Pros & Developers. It's quick & easy.

i am getting error of SQL0811N in db2 stored procedure. please help its urgent!!!

P: 1
my stored procedure in db2 is--->
create procedure temp_bill(in UPC_cd character(6))
language sql
begin
declare prod_cd character(8);declare prod_desc varchar(30);declare discount decimal(2,2);declare
prod_sp decimal(7,2);declare
counts int;declare deal_check char(6);select
deal_id into deal_check from db2admin.product where db2admin.product.upc_cd=UPC_cd;if deal_check is not null then select
prod_id,prod_desc,buy_discount,prod_sp into prod_cd,prod_desc,discount,prod_sp from db2admin.product,db2admin.deal where
db2admin.product.upc_cd=UPC_cd and db2admin.deal.deal_id=db2admin.product.deal_id;els e select prod_id,
prod_desc,prod_sp into prod_cd,prod_desc,prod_sp from db2admin.product
where db2admin.product.upc_cd=UPC_cd;end if;end


i am getting error of SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row.

even my first select statement is having same error in this procedure.

what should i do please help.its very urgent!!
Oct 2 '09 #1
Share this Question
Share on Google+
1 Reply


P: 16
Hello Mohit,

you can do SELECT INTO only if the result returned is one value ... you have more values returned thats why the error SQL0811N

If I would be you I will define the unique key on the deal_id column to be sure only one value is returned.
Jan 13 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.