sql - CASE WHEN...INTO - Stored Procedure -


is there way case when statement?

create or replace procedure example  variable1 varchar;  variable2 varchar;  begin     select (case when number = 1                 this_thing variable1             else                 that_thing variable2) the_other     table; end; 

we cannot 2 outputs single case() statement. best can achieve having 2 separate calls mutually exclusive conditions:

create or replace procedure example      variable1 t69.this_thing%type;     variable2 t69.that_thing%type;  begin     select (case when whatever = 1                 this_thing              else                 null              end )            ,  (case when whatever != 1                 that_thing             else                 null              end )        variable1, variable2             t69; end; / 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -