473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
1 7191
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

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

Similar topics

1
by: Chetan | last post by:
Hi We have Oracle 8.1.7.4 and using .net framework 1.1 with Microsoft client. While executting the stored procedure we are getting an error message. Here is our code. here is the code that...
4
by: shyner | last post by:
Hi Everyone, I've been battling this for two days with no luck. I'm using SQL Server 2000. Here's the mystery: I've got a stored procedure that takes a single varchar parameter to determine...
2
by: dalvigirish | last post by:
Hi, I am new to DB2. I am trying to write a simple stored procedure, but getting the error attached below. ERROR ========================================================== TGT.AUDIT - Build...
0
by: DiNa | last post by:
hi i'm a newbie plez help me... i'm facing this prob while running the program... can anybody help me...? 1026 - Could not find stored procedure 'dbo.SP_AccountListing'.SP_AccountListing ...
17
by: Riaaaa | last post by:
Pls check my code for the stored procedure which i created for the companydetails including companyid P.K. Not Null int(4), companyname Not Null varchar (20), address varchar(30) where...
7
by: sri | last post by:
My environment is DB2v9.1, Windows/AIX and I am trying to compile the stored proc below and I am getting an error, "ERROR SQL0104N An unexpected token "WITH" was found following "User_ID =...
0
by: Riaaaa | last post by:
Hello members, This is the SQL SERVER 2005 stored procedure. It contains the data from the two diff tables. (1)Customer : Here clpid and cardid are composite primary keys with the identity...
0
by: db2user24 | last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded in C and compiled to a shared library, which has been placed in the <DB2 dir>/functions directory. The platform is Linux (using...
4
by: saravananmc | last post by:
Hi All, I am new to Stored Procedures, Cursors. I am getting an error "DB21034E The command was processed as an SQL statement because it was invalid Command Line Processor command. During SQL...
2
by: gjain12 | last post by:
When I am trying to declare a cursor over a temproay table in my stored procedure I am getting some errors. Below are the piece of code from my stored procedure in which I am getting error. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.