Despite the fact that you set a condition, the best way would be to process the register of the record not found or "No data". I would write the code above wrapping the SELECT statement with my own BEGIN / EXCEPTION / END block.
The code could be something like this:
BEGIN SELECT trim(name) INTO fullName FROM (SELECT n.name FROM directory dir, store n WHERE dir.name = n.name AND dir.STATUS NOT IN ('F','L','M') ORDER BY n.imp, dir.date ) WHERE rownum <= 1; EXCEPTION WHEN NO_DATA_FOUND THEN fullName = NULL; END;
Sandeep Jan 17 '14 at 12:59 on 2014-01-17 12:59
source share