Wednesday, December 19, 2012

Simple Oracle Functions


create or replace function test_fun(inval_1 in number, inval_2 in varchar2)
  return varchar2 is
begin
  return(inval_1 || ' - ' || inval_2);
end;


Execute the function

select test_fun(1,'input') as col1,
       test_fun(2,'output') as col2,
       test_fun(3,'inout') as col3,
       test_fun(3,4) as col4
from dual;
       

Output

COL1             COL2           COL3         COL4
1 - input        2 - output     3 - inout        3 - 4



No comments:

Post a Comment