Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select INTO and Forms 5.0 question
-----Original Message-----
From: Karl E. Jørgensen <kjorg_at_msn*DOT*com>
Newsgroups: comp.databases.oracle.server
Date: Friday, January 16, 1998 3:56 PM
Subject: Re: help with select into
>It doesn't make much sense to reference SQL%NOTFOUND after a SELECT ...
INTO
>... FROM... etc. For example:
>
> DECLARE
> myvar number;
> BEGIN
> SELECT some_column
> INTO my_variable
> FROM my_table
> WHERE ... whatever ...
>
> IF SQL%NOTFOUND THEN
> <NEVER-EXECUTED PL/SQL statements !!!!!>
> END IF;
> END;
>
>The reason is that Oracle treats it as an error if your query does not
>return any rows. Thus the select...into... WILL raise an exception
>(no_data_found). Without this, you would not know whether you got a value
>back or not !
>
Oracle does not treat it as an error my version of Oracle Forms (4.5). If
you use
SQL%NOTOFOUND after a select, an exception is not raised. I've used it and
seen it used quite often in Forms (but not in Stored procedures). Is this
no longer true in the new version of Forms (5.0)? Does it not work in
Stored Procedures or SQL*PLUS? I'm planning on upgrading to Forms 5.0 and
I'd like to know what I'm up against.....
Thanks,
Sandy Received on Sun Jan 18 1998 - 00:00:00 CST