Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: insert into returns 0 rows (OFF)
Many thx for the answer, but what do you have against crossposting?
"Syltrem" <syltremzulu_at_videotron.ca> wrote in message
news:85Pfd.232$dq4.12598_at_tor-nn1.netcom.ca...
> Pls do not crosspost
> --------------------
>
>
> Use a cursor ?
>
> Fetch Your_cursor
> If Your_cursor%NotFound
> Then ...
>
>
> --
> Syltrem
>
> OpenVMS 7.3-1 + Oracle 8.1.7.4
> http://pages.infinit.net/syltrem (OpenVMS related web site, en français)
> ---zulu is not in my email address---
> "Agoston Bejo" <gusz1_at_freemail.hu> a écrit dans le message de
> news:clo7dl$iev$1_at_news.caesar.elte.hu...
> > Hi,
> > when a SELECT in an INSERT INTO statement returns no rows, NO_DATA_FOUND
> > exception is raised. How do I write a "nice" SELECT INTO when I expect
> that
> > 0 or 1 row gets returned, and the variable should be NULL if no rows are
> > returned.
> > By "nice" I mean that my intention is clear from the source code and no
> > exception-catching is involved, since that would suggest that I'm
handling
> > such a condition that shouldn't occur.
> > Therefore the following two techniques are not satisfying:
> >
> > SELECT MIN(thefield) INTO myvar ... -- (not clear what is intended)
> >
> > BEGIN --exception handling where no real exceptional condition occurs
> > SELECT thefield INTO myvar...
> > EXCEPTION WHEN NO_DATA_FOUND THEN
> > myvar := NULL
> > END;
> >
> >
> >
> >
>
>
>
Received on Thu Oct 28 2004 - 02:46:12 CDT
![]() |
![]() |