Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Help

Re: SQL Help

From: Peter L <news_at_lenniep.freeserve.co.uk>
Date: Thu, 22 Apr 1999 21:58:32 +0100
Message-ID: <7fo71s$19h$1@news7.svr.pol.co.uk>


You could use:
begin

    select COL_A into a_variable from TABLE where TABLE.COL_B = value exception

    when no_data_found
  then
    a_variable := null;
end;

Paul Davies wrote in message <371f6e3c_at_newsread3.dircon.co.uk>...
>When I have a select statement:
>
>select COL_A into a_variable from TABLE where TABLE.COL_B = value
>
>IF a_variable = null....
>
>within a PLSQL procedure, the procedure bombs out if no values are found.
>In Sybase, however, a_variable would be set to null. Is there a simple way
>I can force the select to behave like this in Oracle - ie it continues if
no
>values are found and sets a_variable to null?
Received on Thu Apr 22 1999 - 15:58:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US