--查询函数
SELECT test_function('1064V110000000000D4M') FROM dual;
SELECT test_function('1064V110000000000D4M') FROM dual;
--根据部门PK查找部门名字并返回
create or replace function test_function(pk IN VARCHAR2 ) return VARCHAR2 is
val VARCHAR2(50);
begin
SELECT deptname INTO val FROM bd_deptdoc WHERE pk_deptdoc=pk;
RETURN val;
end ;
create or replace function test_function(pk IN VARCHAR2 ) return VARCHAR2 is
val VARCHAR2(50);
begin
SELECT deptname INTO val FROM bd_deptdoc WHERE pk_deptdoc=pk;
RETURN val;
end ;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26840734/viewspace-743208/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26840734/viewspace-743208/