# \[Error\] Execution (1: 1): ORA-01403: no data found ORA-06512: at line 5

**URL:** <https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [April 5, 2020, 9:20am UTC](https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490 "2020-04-05T09:20:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoine\_mc1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@antoine\_mc1](https://forums.toadworld.com/u/antoine_mc1)\
**Post date:** [April 5, 2020, 9:20am UTC](https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490/1 "2020-04-05T09:20:14Z")

</div>

Hello,  
Good day,  
If I write 100 it works but if I write 207 it doesn't work.  
Can you help me please?

declare  
e\_loc exception;  
v\_name hr.employees.first\_name%type;  
begin  
select first\_name into v\_name from hr.employees  
where employee\_id = &v\_employee\_id ;  
if sql%notfound then  
raise e\_loc;  
else  
dbms\_output.put\_line('the name is ' || v\_name );  
end if;  
exception  
when e\_loc then  
dbms\_output.put\_line('nope');  
end;

Thank you.

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [April 5, 2020, 2:54pm UTC](https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490/2 "2020-04-05T14:54:35Z")

</div>

The select is raising the no\_data\_found exception, before your check for not found. I suspect.

You probably need a behin-exception-end around the select and in that exception handler, trap no\_data\_found and raise your exception there.

Cheers,  
Norm[TeamT]

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [April 5, 2020, 3:42pm UTC](https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490/3 "2020-04-05T15:42:43Z")

</div>

This is what I mean:

```auto
declare
    e_loc exception;
    v_name hr.employees.first_name%type;
begin
    begin
        select first_name 
            into v_name 
        from hr.employees
        where 
            employee_id = &v_employee_id ;

        dbms_output.put_line('the name is ' || v_name );
    exception
        when no_data_found then
            raise e_loc;
    end;

exception
    when e_loc then
        dbms_output.put_line('nope');
end;

```

HTH

Cheers,  
Norm. [TeamT]

PS. It's Sunday, and the UK is in lockdown. But at least my garage is now very tidy! 😉

---

<div class="post-metadata">

**Author:** ![antoine\_mc1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@antoine\_mc1](https://forums.toadworld.com/u/antoine_mc1)\
**Post date:** [April 5, 2020, 4:34pm UTC](https://forums.toadworld.com/t/error-execution-1-1-ora-01403-no-data-found-ora-06512-at-line-5/49490/4 "2020-04-05T16:34:35Z")

</div>

Thank you so much, thanks a lot  
😉
