473,322 Members | 1,699 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,322 software developers and data experts.

No Data found error

Hi,

I am a newbie to Oracle and stored procedures. Hence this question
comes up. The complete scenario is like this. We have a multithreaded
application using pthreads on HP-UX machine. We are connecting to
Oracle database 8.1.7. The application calls stored procedures on
database using OCI calls. It is also ensured that the our application
is thread safe.

When a particular procedure is called, a SQL select statment returns
an exception NO DATA FOUND. However when we connect though SQL and try
executing the same SQL select query , it is found that the data is
present. Also other SQL select statements in the same procedure prior
to this one work fine. However one difference is there. The flow of
the SQL in the proc is as follows
BEGIN
SELECT
a,
b,
INTO
d_a,
d_b,
FROM X
WHERE condition1 = 10
AND condition2= 3;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99991, no data found --
');
END;

BEGIN
SELECT m INTO d_m
FROM Y
WHERE condition3= d_a
AND condition4 = d_b;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99992, no data found ');
END; --> problem occurs here

Could anyone please tell me what can be cause of this error.

Thanks in advance
Naren
Jul 19 '05 #1
2 40626
Naren wrote:
Hi,

I am a newbie to Oracle and stored procedures. Hence this question
comes up. The complete scenario is like this. We have a multithreaded
application using pthreads on HP-UX machine. We are connecting to
Oracle database 8.1.7. The application calls stored procedures on
database using OCI calls. It is also ensured that the our application
is thread safe.

When a particular procedure is called, a SQL select statment returns
an exception NO DATA FOUND. However when we connect though SQL and try
executing the same SQL select query , it is found that the data is
present. Also other SQL select statements in the same procedure prior
to this one work fine. However one difference is there. The flow of
the SQL in the proc is as follows
BEGIN
SELECT
a,
b,
INTO
d_a,
d_b,
FROM X
WHERE condition1 = 10
AND condition2= 3;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99991, no data found --
');
END;

BEGIN
SELECT m INTO d_m
FROM Y
WHERE condition3= d_a
AND condition4 = d_b;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99992, no data found ');
END; --> problem occurs here

Could anyone please tell me what can be cause of this error.

Thanks in advance
Naren

what are the values of d_a and d_b?
I don't see a declarion like
d_a number := 12;
d_b number := 4;
begin
....

--
Regards, Frank van Bortel

Jul 19 '05 #2
na**********@hotmail.com (Naren) wrote in message news:<82*************************@posting.google.c om>...
Hi,

I am a newbie to Oracle and stored procedures. Hence this question
comes up. The complete scenario is like this. We have a multithreaded
application using pthreads on HP-UX machine. We are connecting to
Oracle database 8.1.7. The application calls stored procedures on
database using OCI calls. It is also ensured that the our application
is thread safe.

When a particular procedure is called, a SQL select statment returns
an exception NO DATA FOUND. However when we connect though SQL and try
executing the same SQL select query , it is found that the data is
present. Also other SQL select statements in the same procedure prior
to this one work fine. However one difference is there. The flow of
the SQL in the proc is as follows
BEGIN
SELECT
a,
b,
INTO
d_a,
d_b,
FROM X
WHERE condition1 = 10
AND condition2= 3;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99991, no data found --
');
END;

BEGIN
SELECT m INTO d_m
FROM Y
WHERE condition3= d_a
AND condition4 = d_b;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error (-20033, '99992, no data found ');
END; --> problem occurs here

Could anyone please tell me what can be cause of this error.

Thanks in advance
Naren

The second block will be executed regardless of the outcome in the
first block. If you have no_data_found in the first block, you handle
this situation (which is good), but you'll need to set up a boolean in
the block and conditionally execute the second block. Otherwise if
there is nothing sensible in d_a and d_b you'll end up with
no_data_found in the second block.

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy | last post by:
Hi, In the code below (not pretty I know but it's an early version :-P) I'm having problems reading the data object back in. If I move the reading code to immediately after the section where it...
32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
6
by: Nathan Kovac | last post by:
Yesterday afternoon I was getting the following errors in a windows service: 'DatabaseManager.DataComponent', 'Error', '3 Errors: Line: 0 - Metadata file 'ScriptingMethods.dll' could not be found...
2
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
0
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
5
by: stmfc | last post by:
i dont know why pl/sql block below returns no data found error. do you have any idea about it? declare c1 varchar2(80); c2 varchar2(80); begin execute immediate 'select col2 from table1 where...
2
by: Naren | last post by:
Hi, I am a newbie to Oracle and stored procedures. Hence this question comes up. The complete scenario is like this. We have a multithreaded application using pthreads on HP-UX machine. We are...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
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...
1
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.