Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Unanswered: SQL0811N error in stored procedure. please help urgent!!!

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

    my stored procedure 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,discount,prod_sp from db2admin.product
    where db2admin.product.upc_cd=upc_cd;end if;end


    please help its urgent!!

  2. #2
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963
    You have to change:

    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
    FETCH FIRST ROW ONLY;

    or


    select prod_id,
    prod_desc,prod_sp into prod_cd,prod_desc,discount,prod_sp from db2admin.product
    where db2admin.product.upc_cd=upc_cd
    FETCH FIRST ROW ONLY;

    Lenny



    or

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •