A Function is a named pl sql subprogarm.A function is always
return single value.
|| Operator in oracle is can be used to concatenate multiple
strings to form a single string.
A syntax to create a function in oracle is as follows:-
Create [or replace] function
function_name[(parameter[,parameter])]
return return_datatype
is|As
[declaration_section]
begin
executable_section
[Exception exception_section]
End[function_name];
Example:-
create or replace function fun1 (x varchar2, y varchar2)
return varchar2
is begin
return x|| ' '||y;
end;
Output:- You could reference your function by in a Sql statement.
select fun1(first_name,job_id) from employees;
0 comments:
Post a Comment
Thank you for your comments we will get back to soon