stored procedures - Oracle - Handle empty resulset on IF THEN ELSE statement -
stored procedures - Oracle - Handle empty resulset on IF THEN ELSE statement -
which should if status when variable assignation results empty resultset?
example:
create or replace function get_values ( chv_input in varchar2 ) homecoming varchar2 chv_output varchar2(100); begin select 'value' chv_output dual 1=2; if chv_output null --this status not working chv_output := 'null'; else chv_output := 'not null'; end if; homecoming chv_output; end; --select 1, get_values('112') dual
try instead:
exception when no_data_found chv_output := 'null';
stored-procedures plsql oracle10g
Comments
Post a Comment