Oracle提供Wrap工具
不過需要注意的是
以下是個例子
create or replace function get_rowid
(l_rowid in varchar
return varchar
is
ls_my_rowid varchar
rowid_type number;
object_number number;
relative_fno number;
block_number number;
row_number number;
begin
dbms_rowid
ls_my_rowid :=
return ls_my_rowid ;
end;
/
[oracle@jumper tools]$ sqlplus scott/tiger
SQL*Plus: Release
Copyright (c)
Connected to:
Oracle
With the Partitioning option
JServer Release
SQL> @f_get_rowid
Function created
SQL> select rowid from dept where deptno=
ROWID
AAABiPAABAAAFRSAAA
SQL> select get_rowid(
GET_ROWID(
Object# is :
Relative_fno is :
Block number is :
Row number is :
SQL> !
[oracle@jumper tools]$ ls
ct
[oracle@jumper tools]$ wrap iname=f_get_rowid
PL/SQL Wrapper: Release
Copyright (c) Oracle Corporation
Processing f_get_rowid
[oracle@jumper tools]$ cat f_get_rowid
create or replace function get_rowid wrapped
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
:
a
b
a
b
b b
b
a
cc d
ef f
:
:
:
:
:
:
:
:
:
:
f :
:
:
:
:
:a
:
:
:
:
f
:
a :
:
:
e :
:
b :
d :
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
c
c
/
[oracle@jumper tools]$ exit
exit
SQL> drop function get_rowid;
Function dropped
SQL> @f_get_rowid
Function created
SQL> select get_rowid(
GET_ROWID(
Object# is :
Relative_fno is :
Block number is :
Row number is :
SQL>
From:http://tw.wingwit.com/Article/program/Oracle/201311/18606.html