ORA-01403 no data found

ORA-01403 no data found

Error
ORA-01403 no data found

SQL> Declare
2 l_id NUMBER;
3 BEGIN
4 SELECT id INTO l_id FROM test1 WHERE name = 'RAM1';
5 /* do something with emp data */
6 END;
7 /
Declare
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 4

Cause
During the fetching of data from the object in PL/SQL queries then then object return no data.

Solution
No data found means that specific filter data is not available in the object.
We need to insert that data or we need to check the table having data then correct our query.

SQL> select * from test1;

ID NAME
---------- ----------
1 RAM
2 sham
3 POOJA

SQL> Declare
2 l_id NUMBER;
3 BEGIN
4 SELECT id INTO l_id FROM test1 WHERE name = 'RAM';
5 /* do something with emp data */
6 END;
7 /

PL/SQL procedure successfully completed.

OERR error Output

oerr ora 01403
01403, 00000, “no data found”
*Cause: No data was found from the objects.
Action: There was no data from the objects which may be due to end of fetch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.