Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NO DATA FOUND ERROR IN FUNCTION USING INTO? ORA-01403
On Fri, 13 Jul 2007 10:04:15 -0700, jobs <jobs_at_webdos.com> wrote:
>I've got this simple select in my function
>
> select m.mcman_cdcli, into clientid
> from mcman m
> where m.mcman_cdani=v_ani;
>
>
>when no rows are found, I get ORA-01403 No Data found.
>
>Do I have to trap this? any way to just set to a default with NVL or
>something, Iv'e tried that and it did not work.
yes, you have to trap this.
Just put the select in it's own begin end block
begin
select m.mcman_cdcli into clientid
from mcman m where m.mcman_cdani=v_ani;
-- Sybrand Bakker Senior Oracle DBAReceived on Fri Jul 13 2007 - 12:24:56 CDT
![]() |
![]() |