Comments in Pl/Sql

This was actually stated in a meeting, by a senior developer. Has anybody ever heard the following?
"The -- uses less space than a blank like, in the compiler"

In case you need proof:
CREATE OR REPLACE PACKAGE space_test_blanks
AS
    v_dummy INT;
END space_test_blanks;
CREATE OR REPLACE PACKAGE space_test_cmmnts
AS
    v_dummy INT;
END space_test_cmmnts;
SELECT *
FROM   user_object_size s
WHERE  s.name LIKE 'SPACE_TEST%';
NAME                        TYPE          SOURCE_SIZE PARSED_SIZE  CODE_SIZE ERROR_SIZE
SPACE_TEST_BLANKS           PACKAGE                75         192        246          0
SPACE_TEST_CMMNTS           PACKAGE               111         192        246          0

Similar Messages

  • How to comment my SQL in PL/SQL so that the comment carries to AWR?

    Is there anything about using comments as in /* some comment */ in a SQL statement in a PL SQL procedure and expecting that to be carried thru to AWR?
    Right now it seems my comments are not visible in the AWR history. I'm wondering if they are compiled out when they are in PL/SQL blocks or not?
    Is there a way to preserve them such that they remain without using dynamic sql?

    steffi wrote:
    Is there anything about using comments as in /* some comment */ in a SQL statement in a PL SQL procedure and expecting that to be carried thru to AWR?Comments are stripped from (static) SQL code written in PL/SQL, unless that comment is a CBO hint.
    It is a "+Good Thing+" as it reduces the memory footprint of the cursor in the shared pool. It also ensures a greater potential degree of cursor sharing as the very same SQL statement with different comments will wind up as a single re-usable cursor.
    Why exactly do you want to see comments in SQL cursors in AWR reports? This is just a high level overview - not sure what enlightenment SQL comments will bring.

  • BUG in Oracle SQL Developer 3.0.04 on the "generating DLL" with comments?

    I'm newbie on oracle, but I think that I found out a bug in Oracle SQL Developer version 3.0.04 on the "generating DLL" tool using "comments".
    I will describe the steps that I gave:
    I created a view, but after I test it I had to change my “where” condition, so I comment the old code and then I wrote the new “where” condition below. After I done that I tried to look at the sql code of my view using “generating DLL” tool, but oracle sql developer only shown me half of the code, a lot of code were missing. Then I began with some test trying to understand what happen and I notice that if I put an invalid sql code in my comment the generating DLL start working with no problems, for example(pseudo-code):
    (COMMENT WITH VALID SQL CODE the "Generating SQL" don't work:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where time_stamp = (select max(time_stamp) from .....)
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    Generating DLL returns this(when the error occurs):
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    (COMMENT WITH VALID SQL CODE the "Generating SQL" work with no problems:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    I believe that "Generating DLL" tool have some problem with the comments, I also used /*...*/ to comment but the problem is still active.
    I notice as well that if I started to add some more comments along the code, the conditions migth change, so I think the problem is related with "comments" code.
    Would you mind telling me if this is a real bug or if I'm doing anything wrong.
    Thank you in advance,
    Rodrigo Campos
    Edited by: 894886 on 3/Nov/2011 5:29

    Hi Rodrigo,
    Thank you for reporting this. The only bug I see currently logged on a comment affecting the generated View DDL involves ending the last line of the definition with a comment, which treats the ending semi-colon (even if on a different line) as part of the comment. That is actually related to a low-priority bug against an Oracle database API.
    Unfortunately, your pseudo-code is a bit complex. Trying a few quick, simpler tests against the standard HR schema did not reproduce the issue. I tried INNER JOIN, and nested SELECTs. It would help greatly if you could provide a test case compilable against one of the standard schema, like HR or SCOTT.
    Regards,
    Gary
    SQL Developer Team

  • Referring to SQL comment table in Script Logic

    Dear all,
      If i have the following combination of dimensions, i.e. "DimA, DimB and DimC", and they will point to a comment in the comment table in SQL, how do i grab the [Comment] from the comment table to be used in my script logic.
      I was adviced to use *select statement, but i can't seem to get it to work.
      Any help is much appreciated.
    Cheers,
    Lip Chean

    Hi,
    *Select allows you to retrieve a list of elements from a dimension or table and save it in a user-defined variable for later use anywhere else in the logic.
    For example, with this instruction:
    *SELECT(%REPORTING_CURRENCIES%, u201CIDu201D, u201CCURRENCYu201D, u201C[GROUP] = 'REP'u201D)
    In this case, you retrieve the ID of all members in the CURRENCY dimension where the property GROUP has the value REP. Running this example fills the variable %REPORTING_CURRENCIES% with the list of reporting currencies defined in the current application.
    Important information
    xxx The SELECT statement generates a SQL query, and NOT an MDX query. This implies that it can be executed against any SQL table existing in the application set database, and not just against the properties of a dimension in the cube. The prefix "mbr" is automatically added to any name entered in the table parameter. Otherwise, the name of the table is taken as is. If
    you want to select a list of elements from a dimension using an MDX query use *MEMBERSET statement.
    xxx In case any parameter contains embedded commas the entire parameter must be enclosed in an extra set of double quotes.
    xxx The *SELECT statement is executed at the time the logic is validated, and the expanded result is written in the LGX file. This means that if the related dimension is modified, it may be necessary to re-validate the logic.
    xxx Statements returning no members do not necessarily cause the validation of the logic to fail. In this case a warning is entered in the validation log.
    xxx These instructions are not specific to a given logic section, but they can be written once anywhere in the logic and used across multiple commit sections.
    Hope this helps.
    Badrish

  • Query using the SQL 'go' command  on a JAVA code

    Hi,
    I am trying to create a new database on MS SQL and at the same time verify whether the data base exist already and then add a new table. The query statement works well on the query windows on MS SQL, but when the query is place using a JAVA code it gives the following error:
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'go'.
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'go'.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Source)
         at DataBaseCreator.main(DataBaseCreator.java:30)
    I have to add that if I only query: "CREATE DATABASE NameOfDatabase" the new data base is created without a problem using JAVA, but when I try to use the following query, I got the error message.
    "USE Master "
                        + "IF EXISTS (SELECT * FROM SysDatabases WHERE NAME='DatesTemps') "
                        + " DROP DATABASE DatesTemps"
                        + " go "
                        + " CREATE DATABASE DatesTemps22 "
                        + " go"
                        + " USE DatesTemps "
                        + " CREATE TABLE Fable ( "
                        + " FableID INT NOT NULL CONSTRAINT FablePK PRIMARY KEY NONCLUSTERED, "
                        + " Title VARCHAR(50) NOT NULL, "
                        + " Moral VARCHAR(100) NOT NULL, "
                        + " FableText VARCHAR(1536) NOT NULL, "
                        + " BlobType CHAR(3) NULL DEFAULT 'doc', "
                        + " Blob IMAGE NULL DEFAULT NULL )"
    If it is useful my complete code is the following, I appreciate in advance your comments.
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.*;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class DataBaseCreator {
         public static void main (String[] args)
              Connection Time =null;
              Statement stmt = null;
              String data = "jdbc:odbc:DataBaseCreation";
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Time= DriverManager.getConnection(data,"","");
                   stmt = Time.createStatement();
                   //String query;
                   //java.sql.Timestamp ts1 = new java.sql.Timestamp(((3*60)+58)*60*1000);
              // System.out.println(ts1 + " This is a Time Stamp");
              ResultSet rec = stmt.executeQuery(
                        "USE Master "
                        + "IF EXISTS (SELECT * FROM SysDatabases WHERE NAME='DatesTemps') "
                        + " DROP DATABASE DatesTemps"
                        + " go "
                        + " CREATE DATABASE DatesTemps22 "
                        + " go"
                        + " USE DatesTemps "
                        + " CREATE TABLE Fable ( "
                        + " FableID INT NOT NULL CONSTRAINT FablePK PRIMARY KEY NONCLUSTERED, "
                        + " Title VARCHAR(50) NOT NULL, "
                        + " Moral VARCHAR(100) NOT NULL, "
                        + " FableText VARCHAR(1536) NOT NULL, "
                        + " BlobType CHAR(3) NULL DEFAULT 'doc', "
                        + " Blob IMAGE NULL DEFAULT NULL )"
              catch( Exception e )
                        System.err.println( e );
                        e.printStackTrace();
              finally
                        try
                             stmt.close();
                             Time.close();
              catch( Exception e )
                        System.err.println( e );
    }

    Ok, first of all thanks for your answer, now what I want to do is the following:
    1) I need to input ((retrieve) every minute some data (Date and Temperature), that I will get from and external device, this is not part of this code.
    2) I want to store that data (Date and Temp) on a data base, here where I need the command to create the data base and to verify whether that data base already exists. In case it has already been created then create new table(s) on it. If it doesn't exist then create and then create new tables.
    3) Each Day (at yyyy mm dd 00:00:00:000 will create a new table, and the name of this table will be yyyymmdd.
    4) Then every minute the java code will retrieve the data and add it to the table in the data base.
    5) That will be a close loop that will be running until the user interrupt it.
    I haven't make the communication code yet, in order to test my code I was thinking to retrieve the data from another data base. This would be just to verify that the JAVA sequence is able to retrieve the data every minute and create new data base and tables.
    For the record I am able to send the queries and retrieve information from SQL running the code in eclipse, that will cover your first observation.
    I am quite new in the forum I am sorry I didn't get the use of code tags.
    Sorry again as I said I am quite new on this, what's a DDL statement.
    Thanks.

  • Content in PL/SQL block

    I am new to PL/SQL. I understand that I can run PL/SQL from sqlplus. But it does not work for me if I put sqlplus command in PL/SQL blocks. For example:
    BEGIN
    IF &1 IS NULL THEN CONNECT username/userpassword
    ELSE CONNECT username/userpassword@&1
    ENDIF;
    END;
    I wonder:
    1) What can be included in PL/SQL block? Can a sqlplus command (like CONNECT) be included in PL/SQL block?
    2) In sqlplus, how to check if the sql script has an command line input parameter,
    like "myscript.sql <input_parameter>"?
    Thank you.

    Just to add a few comments.
    PL/SQL is a formal procedural language. The CONNECT command is not part of this language. So just as PL/SQL cannot understand C/C++ commands, nor can it understand SQL*Plus macro commands.
    The & char is used in SQL*Plus as a substitution variable. SQL*Plus checks the PL/SQL or SQL code block before it sends it to Oracle. SQL*Plus substitutes all & variables first - and changes this code block. Then this changed code block is submitted by SQL*Plus to Oracle for execution.
    You need to grok the basics of client-server here and how the client (SQL*Plus in this case), interacts with the server (Oracle and is PL/SQL engine in this case).
    SQL*Plus does not have a "programming" language - it has a very simplistic macro language. It does not support conditional execution. It does not support loop structures. It is very primitive. And must not be confused with PL/SQL and cannot be mixed with PL/SQL (server-side) code.

  • How to give comments for a particular table

    hi..
    how to give comments for a particular table ..
    select * from user_tab_comments;
    tx in advance..

    Try this.
    SQL> COMMENT ON TABLE EMP IS 'THIS IS SAMPLE EMPLOYEE TABLE' ;
    Comment created.
    SQL> select * from user_tab_comments where table_name = 'EMP'
      2  /
    TABLE_NAME                     TABLE_TYPE
    COMMENTS
    EMP                            TABLE
    THIS IS SAMPLE EMPLOYEE TABLE

  • Strange error in sql*plus in a line with "&"

    Hi friends, this error is very strange:
    Open your SQL*PLUS.
    write this:
    DECLARE
    V_1 VARCHAR2(10);
    V_2 VARCHAR2(10);
    BEGIN
    V_1:=&var1;
    --V_2:=&var2;
    END;
    Why it ask me for a value to var2 ???????????
    Does it ignore the -- at the begining of the line
    (same result with /* */ )
    Thanks,
    Jose.

    It is not an error.
    There are two parsers here doing their thing. The SQL*Plus Parser. The Oracle (SQL and/or PL/SQL) parser.
    SQL*Plus reads a line at a time and processs it. It has no idea whether or a line is actually a comment line for SQL or PL/SQL. It however does see that the line contains a SQL*PLUS substitution variable called &var2. Thus it prompts for a value for this variable (as VERIFY is ON). It substitutes &var2 with the value that the user supplies.
    When the SQL*Plus parser encounters the end-of-block marker (the forward slash in this case), it transmits that block to the Oracle Server for execution. There the Oracle Server runs it through the PL/SQL or SQL parsers (depending on whether the block is SQL or anonymous PL/SQL).
    Nothing strange about it. Nothing wrong with it.

  • How can I format pl-sql code with my own settings

    Are there any tools for formatting pl-sql in SD 1.1 excepting Ctrl-B?
    How can I adopt Ctrl-B for my own needs?

    There are a couple of options you can tweak in Tools - Preferences - SQL Formatter.
    It's very basic at this time, but will be enhanced in future releases. You can vote to add weight and add comments on the SQL Developer Exchange, there are 3 or 4 requests already for this.
    K.

  • Help in PL/SQL

    Hello
    I have a doub whether the following is possible with PL/SQL
    We have a oracle application which stores the data in the DB. We are having a request to transfer a part of this application's data to another applcation which takes care of the finances.
    For that we need
    1. To create a table that picks data from the DB
    2. Put it in a file and
    3. Filename has a sequence number &#8211; to make sure no files are missed, and files are not processed twice.
    4. To have file header contains a batch number &#8211; to make sure a batch is not processed twice, and is in sequence, and that the filename has not been changed
    5.create checksum for the file
    6.finally to transfer the file.
    Could you help me to know how to create file in PL/SQL and to create header records, sequence number generation ?
    Thanks.

    >I have a doub whether the following is possible with PL/SQL
    An offensive comment to PL/SQL.. or you do not know PL/SQL at all.
    I would not use UTL_FILE.
    I would create the entire file as a CLOB (column in a table). Which means the file contents are subject to database security, audting, concurrency, archiving, and all the other good stuff.
    I would not create the file directly on the o/s alone. Where it can be accidentally deleted from the o/s by nobody (something which I have seen happening more than once).
    Thus I will construct the file as a CLOB and keep it as the master copy. For the file transfer, whether an actual o/s file copy is created depends on whether the transfer is a push or a pull. If a push, I would not even bother writing the CLOB to a physical o/s file - I will push it inside PL/SQL using FTP or HTTP.
    If a pull.. if the pull is HTTP, then again PL/SQL wil be used (via MOD_PLSQL) and no physical o/s file will be created. If the pull is FTP or SFTP, then an o/s file may need to be created. But I would first consider using XMLDB for that and the raw FTP session interface - which means the controls are all Oracle and Oracle listener based, with no reliance on o/s utilities and o/s security, and fully portable to any Oracle platform.
    I have my doubts if there are anything (in the realm of standard business IS needs) that cannot be done in Oracle.. and PL/SQL.

  • Error with PL/SQL xmlGen if unlimited rows

    If I run xmlgen server side from pl/sql and I dont specify a limit on the rows I get the following error
    xml version=1.0
    ERROR
    oracle.xml.sql.OracleXMLSQLEception
    ORA-00600: internal error code, arguments: [kdlseek-kgbtnscb]
    ERROR
    If limit the rows it works ok, the generated xml is not that big only about 600 rows
    Any ideas on whast the problem
    Rob

    I too get the same problem. Has anyone come up with a solution, not a workaround?
    SQL> select xmlgen.getXML('select * from dict where table_name like ''%ROLE%''') from dual;
    XMLGEN.GETXML('SELECT*FROMDICTWHERETABLE_NAMELIKE''%ROLE%''')
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DBA_ROLES</T
    SQL> select xmlgen.getXML('select * from dict') from dual;
    select xmlgen.getXML('select * from dict') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code,
    arguments: [kdlseek-kgbtnscb], [], [], [], [], [], [], []
    ORA-06512: at "SCOTT.XMLGEN", line 465
    ORA-06512: at "SCOTT.XMLGEN", line 456
    ORA-06512: at line 1
    SQL> select count(*) from dict;
    COUNT(*)
    851
    SQL> describe dict;
    Name Null? Type
    TABLE_NAME VARCHAR2(30)
    COMMENTS VARCHAR2(4000)
    SQL>
    shared_pool_size = 52428800 # 50MB
    large_pool_size = 614400
    java_pool_size = 41943040 # 40MB
    W2K V5 SP1, 8.1.6 RLSE2 & XSU1.2
    Steve.
    null

  • SQL protection - best practises

    I need some help to understand the difference between Express full backup vs. syncronization for SQL protection. I have always thought that the SQL logs were truncated during a Express full backup, but have read several articles that claim the opposite.
    What is best practise in order to protect SQL DB's in general? And which recovery models should be used (full/simple)?
    /Amir

    Please read below
    Backing up SQL with DPM
    Why DPM 2010 and SQL are Better Together?
    SQL Logs not getting truncated ?
    (comments)
    SCDPM: Backup SQL and Truncate SQL Logs
    Have a nice day !!!
    DPM 2012 R2: Remove Recovery Points

  • Javadoc like tool for PL SQL

    Hi ,
    Is there any document generator tool for PL/SQL.
    Thanks in advance.

    Is anyone currently using NaturalDocs for PL/SQL documentation?
    http://www.naturaldocs.org/
    It seems to be about the only project out there that is still being maintained and expanded. The downside is that NaturalDocs does not currently read javadoc-type comments for PL/SQL code (looks like a long while before it will), rather you need use the NaturalDoc-style of comments.
    However the resulting documentation is quite nice looking (compared to pldoc):
    http://www.naturaldocs.org/documentation/html/files/NaturalDocs-.html
    Some larger projects such as OpenLayers use this:
    http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers-js.html
    but nothing I could find anywhere actually showed PL/SQL code in the documentation.
    Thanks,
    Paul

  • Commented Code

    I have thousand of commented code in my procedure suppose I delete all commented code and remove all dbms_output statment will it Improve performance?
    Pls reply
    Umesh

    Not saying comments is a bad thing in itself. But comments in a SQL (depending on the Oracle version) can wind up in the Shared Pool. It is also can prevent a SQL from being sharable.
    This is what happens in 9i when you use comments in the SQL. It winds up in the Shared Pool:
    SQL> create or replace procedure fooProc is
    2 i integer;
    3 begin
    4 select
    5 /* this is comment line 1
    6 line2
    7 and yet another comment
    8 */
    9 count(*) into i
    10 from user_objects;
    11 end;
    12 /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> exec fooProc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select sql_text from v$sqlarea
    2 where sql_text like '%user_objects';
    SQL_TEXT
    SELECT /* this is comment line 1 line2 and yet another comment
    */ count(*) from user_objects
    SQL>
    The 10g parser is more clever than this and will strip out non CBO comment hints from the SQL (and remove whitespaces and formatting) in order to "clean" the SQL and making it more uniform and thus more likely sharable with the same SQL that has been formatted differently. Here's a 10g example:
    [pre]
    SQL> create or replace procedure fooProc is
    2 i integer;
    3 begin
    4 select
    5 /* this is comment line 1
    6 line2
    7 and yet another comment
    8 */
    9 count(*) into i
    10 from user_objects;
    11 end;
    12 /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> exec fooProc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select sql_text from v$sqlarea
    2 where sql_text like '%USER_OBJECTS';
    SQL_TEXT
    SELECT COUNT(*) FROM USER_OBJECTS
    SQL>
    Note - all uppercase and no comments.
    It was just simply good practice to rather comment before or after a SQL in the past. Not so much relevant anymore, but lots of people still are using 9i and should note this.

  • How to query table/comment information and lookup table names from PKs?

    I am trying to figure out whether I can query the Oracle meta-data to look for:
    a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
    SQL> desc all_col_comments
    Name Null? Type
    OWNER NOT NULL VARCHAR2(30)
    TABLE_NAME NOT NULL VARCHAR2(30)
    COLUMN_NAME NOT NULL VARCHAR2(30)
    COMMENTS VARCHAR2(4000)
    SQL> desc user_tab_comments
    Name Null? Type
    TABLE_NAME NOT NULL VARCHAR2(30)
    TABLE_TYPE VARCHAR2(11)
    COMMENTS VARCHAR2(4000)
    See http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:233014204543.
    b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
    select c.table_name,c.constraint_name, --c.r_constraint_name,
    cc.table_name
    from all_constraints c
    inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
    See http://stackoverflow.com/questions/3210743/viewing-oracles-metadata-about-primary-foreign-key-constraints.
    c) I am not sure whether it is possible to draw a database entity model, perhaps using software, assuming that the primary/foreign keys have been already defined within Oracle 11g. Is software available to do this?

    Hi,
    a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
    SQL> desc all_col_comments
    Name Null? Type
    OWNER NOT NULL VARCHAR2(30)
    TABLE_NAME NOT NULL VARCHAR2(30)
    COLUMN_NAME NOT NULL VARCHAR2(30)
    COMMENTS VARCHAR2(4000)
    SQL> desc user_tab_comments
    Name Null? Type
    TABLE_NAME NOT NULL VARCHAR2(30)
    TABLE_TYPE VARCHAR2(11)
    COMMENTS VARCHAR2(4000)
    ....... The dictionary views are the same . A query with regular expressions may help in identifying the matching strings in comments.
    b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
    select c.table_name,c.constraint_name, --c.r_constraint_name,
    cc.table_name
    from all_constraints c
    inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
    ....... There is one more view for constraints. USER_CONS_COLUMNS may be of help.
    Padma

Maybe you are looking for