The largest technology show is discussed and relived at Oracle OpenWorld group. We share events, updates, Oracle and Oracle jobs for consultants and people to learn Oracle
Hi All,
i am using Select Into statement in my stored procedure to get the data from the table and use that .It works fine if the condition return the data But if the select statement does not return any row it gives an exception.
i need to use that data in a mail template.Kindly help
Thanks
Felix Moret
Thannks for the Suggestion...this will solve my problem
But i just want to know that...Isn't there is any other better way to do it.
Thanks
Jun 10, 2013
Leoma Cheesman
Try using decode.
tableName: test
select decode((select testId from test),null,1,2) from dual;
If the record set is NULL, you will get 1 as output.
Else you will get 2 as output.
for more info,
http://eoracle11g.blogspot.com/
Jun 10, 2013
Leoma Cheesman
When using decode, don't forget to add
where rownum<2
because if there are multiple records in result set, inner query will throw an error.
Jun 10, 2013