Home » Developer & Programmer » Designer » Table references on PL/SQL Modules
Table references on PL/SQL Modules [message #127042] Fri, 08 July 2005 03:44 Go to next message
srtAndi
Messages: 1
Registered: July 2005
Junior Member
Is needed for reverse engineering:
How can i create a reference between a table and a PL/SQL function/module ?
Re: Table references on PL/SQL Modules [message #172633 is a reply to message #127042] Wed, 17 May 2006 07:45 Go to previous message
pgroen
Messages: 4
Registered: May 2006
Junior Member
To the best of my knowledge: You can't.

But you can find the references in the database, querying the USER_DEPENDENCIES view...

Example:

SQL> CREATE OR REPLACE FUNCTION dumb_function
  2     RETURN NUMBER
  3  IS
  4     vResult         NUMBER;
  5     vDumbVariable   dept.deptno%type;
  6  BEGIN
  7     SELECT count (*)
  8       INTO vResult
  9       FROM emp;
 10  
 11     RETURN vResult;
 12  END dumb_function;
 13  /

Function created.

SQL> SELECT referenced_owner, referenced_name
  2    FROM user_dependencies
  3   WHERE NAME = 'DUMB_FUNCTION' AND referenced_type = 'TABLE'
  4  /

REFERENCED_OWNER               REFERENCED_NAME
------------------------------ ----------------------------------------------------------------
SCOTT                          DEPT
SCOTT                          EMP
Previous Topic: Is it good to have many databases in one server?
Next Topic: E-R & SQL script reverse engineering
Goto Forum:
  


Current Time: Thu Mar 28 12:43:19 CDT 2024