Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Raising an exception for SELECT statement

258676Apr 16 2002
Hi,

Exception is not raised if we use the max function in an sql query.

The sql query we used is as shown below.

select max(column1) into var1
from table1
where column2=100;


we are executing this query in a procedure and we don't have any rows in the table. The variable var1 is initialised to 100 but after executing this query the value was set to NULL.

Since we don't have rows in the table it should raise "No data found" exeception but the observed behaviour is not so.


If we modify the query to :

select column1 into var1
from table1
where column2=100;

It is raising the exception.

Can you please let us know the reason why after using the function MAX in the query is not raising an exception.

Thanks in advance.

Lakshmi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2002
Added on Apr 16 2002
3 comments
271 views