Raising an exception for SELECT statement
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