--如何调用该过程
call function_name(参数值1,参数值2);
--创建function来查询某个雇员的工资
create or replace function fj_fun1(fjname varchar2) return number is yearsal number(7,2); begin select sal*12+nvl(comm,0)*12 into yearsal from tb_Employee where ename=fjname;--执行部分 return yearsal; end; / var abc number; call fj_fun1(‘SCOTT‘) into:abc;--调用
--create function
create or replace function fj_ft1( string1 varchar2, string2 varchar2 ) return varchar2 is begin return string1||string2; end; / --调用 select fj_ft1(‘hello‘,‘world‘) from dual; --调用时等效于下面这段 var abc varchar2; call fj_ft1(‘hello‘,‘world‘) into:abc;
时间: 2024-11-09 23:20:00