Categories: Oracle Errors

ORA-01403: No data found| Resolution of ORA-01403

ORA-01403: No data found :

In my previous articles, I have given the proper idea of different oracle errors, which are frequently come. In this article, I will try to explain the most common error, which has been searched on google approximately 10 k times per month. ORA-01403 is coming when PLSQL variable does not found any data. ORERR utility may provide the information of this error, which is ‘No data found’ error. Most of the time developer forget to handle this error in PLSQL code. There might be different possible reasons for this error.

Cause and resolution of this error :

The main cause of this error is variable does not found any data. In this article I will try to give different causes for this error.

1.Select Into clause does not found any data :

This is the base reason of this error. This error will come when variable does not found any data.kindly check the following example for the same.

Example :

DECLARE

V_SRNUM VARCHAR2(20);

BEGIN

SELECT SR_NUM

INTO V_SRNUM

FROM S_SRV_REQ

WHERE ROW_ID = ‘124’;

DBMS_OUTPUT.PUT_LINE(V_SRNUM);

END;

Output :

ORA-01403: no data found

ORA-06512: at line 4

01403. 00000 –  “no data found”

*Cause:

*Action:

Resolution of this error :

Handle the exception :

To resolve this error PLSQL developer needs to handle the given exception carefully. So the code will be changed as follows :

DECLARE

V_SRNUM VARCHAR2(20);

BEGIN

SELECT SR_NUM

INTO V_SRNUM

FROM S_SRV_REQ

WHERE ROW_ID = ‘124’;

DBMS_OUTPUT.PUT_LINE(V_SRNUM);

Exception WHEN NO_DATA_FOUND THEN

dbms_output.put_line(‘Exception came’);

END;

2.Use of UTL_FILE package :

When you are using UTL_FILE package this error will occur.There was an attempt to read past the end of file when using the UTL_FILE package.

Resolution of this error :

Fix the code stop running prior to reading end of file.

3.Logical standby :

There might be the possible cause of using LOGICAL STANDBY statement. Previous use of Skip rule on DML operations causing a data mismatch. In this case simply skip the transaction and restart the apply process.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Share
Published by
Amit S

Recent Posts

What is Root Cause Analysis (RCA) With real examples

In my previous article I have given details about application support engineer day to day…

4 weeks ago

Application Support Engineer Day to day responsibilities

In my previous articles I have given the roles and responsibilities of L1,L2 and L3…

1 month ago

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

1 month ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

1 month ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

1 month ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

1 month ago