In a recent interview I was asked to write a simple PL/SQL code to throw NO_DATA_FOUND exception without actually raising it from the code. I am wondering what could be a simple pl/sql snippet to do so. Probably using dual?
Simple PL/SQL code to throw NO_DATA_FOUND exception
oracleplsql
Best Answer
Many ways, but as you suggested, you can use
DUAL
:It'll produce a
ORA-01403: no data found
whenexecute
d.