scott@eddev> select empno, ename, mgr
2 from emp
3 /
EMPNO ENAME MGR
---------- ---------- ----------
7369 SMITH 7902
7499 ALLEN 7698
7521 WARD 7698
7566 JONES 7839
7654 MARTIN 7698
7698 BLAKE 7839
7782 CLARK 7839
7788 SCOTT 7566
7839 KING
7844 TURNER 7698
7876 ADAMS 7788
7900 JAMES 7698
7902 FORD 7566
7934 MILLER 7782
14 rows selected.
scott@eddev> create or replace function
2 is_rank_higher_fn (
3 first_empno_in in number,
4 second_empno_in in number)
5 return number
6 as
7 emprank_v pls_integer;
8 begin
9 with main as (
10 select empno, level emprank
11 from emp
12 where empno in
13 (first_empno_in,second_empno_in)
14 connect by mgr = prior empno
15 start with mgr is null
16 )
17 select emprank
18 into emprank_v
19 from main
20 where empno = first_empno_in
21 and emprank > (
22 select emprank
23 from main
24 where empno = second_empno_in);
25 return 1; -- true
26 exception
27 when no_data_found then
28 return 0; -- false
29 end is_rank_higher_fn;
30 /
Function created.
scott@eddev> select is_rank_higher_fn(7566, 7788)
2 from dual
3 /
IS_RANK_HIGHER_FN(7566,7788)
----------------------------
0
scott@eddev> create or replace operator is_rank_higher
2 binding(number, number)
3 return number using is_rank_higher_fn
4 /
Operator created.
scott@eddev> select is_rank_higher(7566, 7788)
2 from dual
3 /
IS_RANK_HIGHER(7566,7788)
-------------------------
0
请问我怎么查询 operator is_rank_higher 的定义呢? (procedure,function,package 查 dba_source; view 查 dba_views, trigger 查询 dba_triggers)
dba_dependencies 可以查依赖的对象, 但这并不时具体的定义....