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

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -