oracle函数一:
create or replace function getBin
return varchar2
is
result varchar2(50);
begin
select count(1) into result from bing1;
return(result);
end;
测试代码:
declare
result varchar2(50);
begin
result:=getBin;
dbms_output.put_line(result);
end;
oracle函数二:
create or replace function getBin3(ename in varchar2)
return varchar2
is
result varchar(50);
begin
select count(1) into result from bing1 t where t.name1 like '%'||ename||'%';
return(result);
end;
测试代码二:
declare
result varchar2(50);
ename varchar2(10):='a';
begin
result:=getBin3(ename);
dbms_output.put_line(result);
end;