Syntax of PL/SQL without papers. Keyword 'private '.

Hello
I'm a PL/SQL-programmer and programmer Ada too. PL/SQL is derived from Ada83. Now since I'm used to Ada sometimes I Ada syntax elements in the PL/SQL code. Normally, the PL/SQL-compiler complains and does not compile. But look at the following example:

create or replace package privatetest is
var varchar2 (100): = 'Test ';
operative;

private - Word - key undocumented
PrivateVar varchar2 (100): = 'Test ';
end privatetest;
/
create or replace package body is privatetest
test procedure
is
l_var varchar2 (100);
Start
l_var: = privatevar;
PrivateVar: = l_var;
end test;
end privatetest;
/

This can be compiled with PL/SQL release 10.2.0.4.0. Private package dry parts are normal in Ada Ada allows the children to packaging and then you need this mechanism of masking. In more complex situations, I met a strange behavior during execution so 'private' is used in PL/SQL.

Question: Is this a historical vestige that the compiler accepts the keyword or ist it plans to allow the private parts child packing in the future releases from PL/SQL?

Kind regards
Frank Piron

user5200696 wrote:
I wanted to point to this "feature" without papers because it is a real trap for Ada programmers who write code in PL/SQL too.

It smells the opportunity to write your ADA-> PL/SQL experiences in a blog or an article - it seems like a shame to your experiences of learning to go not shared.

Tags: Database

Similar Questions

  • How to write the SQL without using dynamic SQL?

    How can you write this under SQL without using execute immediately?

    You can use static SQL (using something like a CASE statement)?

    test procedure (one in varchar2, b number, each number) is

    v_num_recs pls_integer;

    Start

    Select count (*)

    in v_num

    FROM table1

    where

    col1 = one and

    If b is not null then col2 = b

    If c is not null then col3 = c;

    / * i.e. If b is not null, where condition to add this line only. If c is not null, where condition should add only this line. OR condition No. it * /.

    dbms_output.put_line (v_num);

    end;

    Or should I use dynamic SQL statements for this?

    I was wondering if the two are NOT NULL? Well check this.

    Select count (*) in v_num

    table

    where col1 = one

    and col2 = (CASE WHEN (b is not null) THEN b ELSE END col2)

    and col3 = (CASE WHEN (c is not null) THEN ELSE END col3 c)

  • The query sql without prescription by will return same result on several tracks?

    Hello

    I have a sql without a prescription and I limit the number of rows to 100 max per rownum < 100. Now the question is, if the data set on which this sql is running, does not change, the sql returns the same result the performance of several?

    For example, there are 150 lines and the sql returns 100 rows because of rownum < 100. Now running the same sql several times, I have the same set of 100 lines? or it could be 150? On the basis of these the kind of database engine and return data when no order by clause are provided?

    Thank you for your time.

    -Hozy

    Hi, Hozy,

    Hozy says:
    Hello

    I have a sql without a prescription and I limit the number of rows to 100 max per rownum< 100.="" now="" the="" question="" is,="" if="" the="" data="" set="" on="" which="" this="" sql="" runs,="" does="" not="" change,="" will="" the="" sql="" return="" the="" same="" result="" set="" on="" multiple="">

    N ° if there is no ORDER BY clause, then there is no guarantee that the order will remain the same. If the table is small, the output will probably be the same thing, but you can't count on it.
    I guess that you do not have a CONNECT BY query. CONNECT BY queries without ORDER BY clause or brothers and SŒURS of ORDER BY, the output is partially ordered.

    For example, there are 150 lines and the sql returns 100 rows due to rownum< 100.="" now="" on="" executing="" the="" same="" sql="" multiple="" times,="" will="" i="" get="" the="" same="" set="" of="" 100="" rows?="" or="" it="" could="" be="" any="" of="" the="" 150?="" on="" what="" bases="" these="" the="" database="" engine="" sort="" and="" return="" data="" when="" no="" order="" by="" clause="" is="">

    No, you necessarily will not get the same 100 lines each time. ROWNUM reflects the order in which the establishment has recovered the lines.
    Say you run the query at 11:00. Maybe do you a full table scan to obtain the data on the drive, and the order of the lines is determined by how it data happens to be on the disk. As the data is read from the disk, it is cached in memory.
    Say you run the same exact query at 12:00, without changing the table. Instead of retrieve all data from the disk, Oracle will try to use the blocks that are cached in memory, which is not necessarily the way the blocks are stored on the disk. If some of the older blocks 11:00 to 12:00 (otherwise said, some, but not all, blocks are more in memory because memory was required for other purposes), then the items picked up at 11:00 can be recovered first at 12:00 and the lines that I have high ROWNUMs at 11:00 can get low ROWNUMs at 12:00. (See Matthew 7:30.)

    Again, you would never notice it on a small table. You can run this query

    SELECT  ename
    FROM    scott.emp
    WHERE   ROWNUM  < 10;
    

    a thousand times and get the same results every time. You will get the same results the 1001eme time? Probably, but not necessarily.

    If you want the output to be in a particular order, to use an ORDER BY clause in the main query.
    If you want ROWNUM to reflect a particular order, use a subquery with an ORDER BY clause and ROWNUM reference in the main query.

  • Convert: DC, SQL, and App Server private vSwitch for app update test?

    I need to upgrade an application that has been installed by my predecessor.  It is a web application that communicates with a SQL Server server to another server.

    Here are the details of the machine:

    • DC1 - Windows 2003

    • SQL1 - Windows 2000, SQL 2000

    • App1 - Windows 2003, use IIS to app

    I thought who would use Converter to convert each test VMs on my ESX host power off, change their vSwitch to a private vSwitch and then turn them on.  Two questions:

    • Does make sense?

    • Would it work without bringing down (I know that I would need to restart the Server 2000 during the installation of the Converter agent) nor affect the prod servers?

    • For any other questions?

    -MattG

    If you find this information useful, please give points to "correct" or "useful".

    Quite possible.  I do now with my existing servers.  I used the converter to make copies of all my servers VM.  For most for DR purposes, but also for dev/testing, as you plan to do.  For example, before installing an update about our applications, we charge then on the test of virtual machines.  (In fact, that's how I convinced my manager on why we should use virtualization.)  I did the conversion of servers as a project parallel on my own time and it showed our DC, Exchange, SQL & a virtual performed work on an isolated virtual switch station, hosted by my XP workstation.  )

    When I did my conversion, I made a clone of warm with machines, but I did not all users online at this time.  You can stop your applications to reduce the risk of corruption.  I had to restore AD that I could not log on to the virtual domain controller after the conversion.  This does not always happen with P2V of domain controllers, but you should have a backup of your ad to the case where.  Cold clone would have less of a problem with this kind of corruption.

  • Dynamic SQL without using SQL

    I have a variable that contains a formula, for example.
    V_FORMULA varchar2 (200): = '5 * 50 + 200';

    I want to assign the result of the formula in another variable, without the help of a call from DB with SQL.

    for example.
    Number V_RESULT;

    V_RESULT: = DBMS_surprise_package (V_FORMULA);

    I want V_RESULT to 450 after the statement is executed.

    Is this possible? Is there such a PLSQL package?

    I think that the package of forms NAME_IN done something similar.

    Where my point about cursor_sharing.
    You can assign only it FORCE (Oracle will be more or less "auto-bind", you'll see: SYS_B0 variable etc. appear in drawings if you trace/tkprof this session) for the session which made the treatment and see if it behaves better.
    It should result in (a lot) less parsed and/or invasion of your shared pool.
    You can test quickly and easily:

    SQL> sho parameter sharing
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    cursor_sharing                       string      EXACT
    SQL> alter session set cursor_sharing='FORCE';
    
    Session altered.
    
    SQL> run_your_program_here...trace it or measure timing and compare duration
    
    SQL> alter session set cursor_sharing='EXACT';
    
    Session altered.
    
    SQL> 
    
  • Developer SQL without opening the script runing script

    Hi, I exported to other tables in an insert script and I got big enough file - 186 MB-> 1123380 rows in the table.
    Now I want to run this script, but the file is too large to open it in sql developer.
    Is there an option like runing script file (without opening the script in sql developer)?

    Thank you, Dan

    In a worksheet, enter @scriptname and press F9.

    I'm not sure of what the impact on the memory usage to perform it like that. A better alternative for large scripts might be to use sqlplus.

  • How do I restore procedure PL/SQL without rolling back content of medium level

    Hi all

    I called a PL/SQL, conditions procedure I want to roll back the changes made by PL/SQL procedure without touching the changes made at the level of the OS, is this possible? If so how.

    Please help it is urgent.


    Thanks and greetings
    MS

    Hello

    Thank you to use getTransaction () .executeCommand ("rollback") of your AM, it will solve your problem.

    If you want clarification on this please consult the JDev guide Chapter 5, implementing features server-side > Rollback methods.

    Kind regards
    Out Sharma

  • get EST for sql without running against PB? possible?

    Hello

    is there anyway to get a query run time without running on the database? even an estimate would be good... I'm on 10.2.0.3... .i am it might be impossible for... but anyway to get the estimate and more setting autotrace only? as I said, they don't want anything but as an estimate for how long time will it take to complete the query... I know we can see very long_ops but like I said... without running against the DB... .is it possible? as the command explain plan that I have watch time? but is that how long it will take to finish or? /

    Select * from table (dbms_xplan.display);
    -----------------------------------------------------------------------------   
    | Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     |   
    -----------------------------------------------------------------------------   
    |   0 | SELECT STATEMENT     |      |    56 |  3192 |     9   (0)| 00:00:01 |   
    |   1 |  MERGE JOIN CARTESIAN|      |    56 |  3192 |     9   (0)| 00:00:01 |   
    |   2 |   TABLE ACCESS FULL  | DEPT |     4 |    80 |     3   (0)| 00:00:01 |   
    |   3 |   BUFFER SORT        |      |    14 |   518 |     6   (0)| 00:00:01 |   
    |   4 |    TABLE ACCESS FULL | EMP  |    14 |   518 |     2   (0)| 00:00:01 |   
    -----------------------------------------------------------------------------   

    The theory is that 'time' in an explain Plan is an estimate.

    However, it is so very dependent on
    a. statistical system and correct assessment of the speed of the CPU, SingleBlockReadTime and MultiBlockReadTime
    b. table, column, index and estimates appropriate size statistics and the number of blockreads for the execution plan
    c. cardinality ("Rows") is estimated at each stage of the particular execution plan

    What is, in most cases, the entry "wrongest" is the cardinality estimate and that changes everything.

    I would use 'time' in a Plan with the exception of the simplest to explain SQL statements and good statistics on the table (however multi-column predicates can still cause bad cardinality estimates).
    Therefore, I would use the estimation of 'Time' almost never.

  • processor sql without editing Viewer

    Hello

    Is there a way to change the query processor without using the Oracle CEP Viewer? For example, the EPN assembly file has a piece of code:
         <wlevs:processor id="myProcessor" queryURL="??"/>
    If I put the queryURL attributes, it is read only once or at the specified interval? How can I do dynamic processor without Visualizer CEP component?

    Thank you.

    Yes, you can use the command line to do:

    java-jar $BEA_HOME/bin/wlevsadmin.jar-url service: jmx:msarmi://localhost:9002/jndi/jmxconnector, wlevs - username username-password wlevs ADDRULE-application applicationName-processor processorName-rule ruleName ' select * from... ". »

    Please refer to the CEP documents for more details.

    Thank you
    Jünger

  • Exit SQL without ROWNUM

    Dear all,

    I also have the following SQL query that returns the no_lig argument. I want it should not return no_lig in the final result, but it must always use no_lig to control the number of rows.

    SELECT a.*
    DE)
    No_lig SELECT rownum, tr.prim_obj_id | TR.teas_id | to_char(res.read_date,'dd-mon-yyyy') | Res.read_time,
    Res.numeric_val
    OF t_teas_ass tr.
    res t_resultant,
    model of t_cmp,
    t_poy poy
    WHERE res.old_ind = 0
    AND res.data_set_id = 'DCVS_DATA. '
    AND tr.teas_id = 'poy_HR_MTR_EF_P. '
    AND res.trd = tr.ass_id
    AND tr.prim_obj_id = poy.obj_id
    AND comp.obj_id = poy.owner_obj_id
    AND res.inst_date BETWEEN TO_DATE ("'01-mar-2009', ' dd-mon-yyyy")
    AND TO_DATE (31-mar-2009 "," dd-mon-yyyy "")
    AND cmp_type_code = 'DISCO '.
    AND poy.poy_type_code = 'POWER '.
    AND comp.start_date < = TO_DATE (31-mar-2009', 'dd-mon-yyyy')
    AND (comp.end_date > = TO_DATE ('01 - mar - 2009 "," dd-mon-yyyy ""))
    GOLD comp.end_date IS NULL)
    AND poy.start_date < = TO_DATE (31-mar-2009 "," dd-mon-yyyy "")
    AND (poy.end_date > = TO_DATE ('01 - mar - 2009 "," dd-mon-yyyy ""))
    GOLD poy.end_date IS NULL)
    AND tr.start_date < = TO_DATE (31-mar-2009', 'dd-mon-yyyy')
    AND (tr.end_date > = TO_DATE ('01 - mar - 2009 "," dd-mon-yyyy ""))
    GOLD tr.end_date IS NULL)
    AND decode the comp.cmp_id IN ('ADDC', 'ALL', comp.cmp_id, "ADDC")
    ORDER BY 1
    ) a
    WHERE no_lig > 60000;


    Your answer to this will be highly appreciated.

    Thank you

    Have you added the concatenated_col at the end of your concatenated column alias?

    tr.prim_obj_id ||tr.teas_id|| to_char(res.read_date,'dd-Mon-yyyy')||res.read_time   concatenated_col,
    

    I would like to "BOLD", but the forum does not support highlighting of the formatted code.

  • Evaluate the Expression of PL/SQL without SQL engine

    I have an expression similar to ' 1 + 2 + (3 * 6) / 12 * (10 * 3, 3) ROUND ' I generate programmatically in VARCHAR2 variable. One way to calculate the expression is 'select' immediate execution. exp |' double ' in lv_x; which returns the value. But my shared pool fills up as I do this thousands of times in some cases longer. I tried in vain to use bind variables.
    1. is there a way to temporarily disable shared before the application pool a turn after the execution of the query?
    2. is it a simple operation in PL/SQL which evaluvates the expression? If this isn't the case, I may be painfully write a.
    Please advice

    This might work for you as the first step (no function)?

    create or replace function evaluate_expression(p_expression in varchar2) return number is
      ret_val number;
      sep varchar2(1) := '|';
      operand_stack varchar2(4000) := sep;
      operator_stack varchar2(4000) := sep;
      w_expression varchar2(4000) := replace(p_expression,' ','');
      i pls_integer := 1;
      next_char varchar2(1);
      num_in boolean := false;
      top_operator varchar2(100);
      left_operand varchar2(100);
      right_operand varchar2(100);
    
      function pop_stack(p_stack in out varchar2) return varchar2 is
        ret_val varchar2(4000);
      begin
        ret_val := rtrim(substr(p_stack,instr(p_stack,sep,-1,2) + 1),sep);
        p_stack := substr(p_stack,1,instr(p_stack,ret_val||sep,-1,1) - 1);
        dbms_output.put_line('pop_stack: '''||ret_val||''' = '||substr(p_stack,1,100));
        return ret_val;
      end;
    
      function peek_stack(p_stack in varchar2) return varchar2 is
        ret_val varchar2(4000);
      begin
        ret_val := substr(rtrim(p_stack,sep),instr(rtrim(p_stack,sep),sep,-1) + 1);
        dbms_output.put_line('peek_stack = '''||ret_val||'''');
        return ret_val;
      end;
    
      procedure push_stack(p_stack in out varchar2,p_item in varchar2) is
      begin
        p_stack := p_stack || p_item || sep;
        dbms_output.put_line('push_stack: '''||p_item||''' = '||substr(p_stack,1,100));
      end;
    
      function is_empty(p_stack in varchar2) return boolean is
        ret_val boolean;
      begin
        if p_stack = sep then
          ret_val := true;
        else
          ret_val := false;
        end if;
        return ret_val;
      end;
    
      function precedence(p_operator in varchar2) return pls_integer is
        ret_val pls_integer;
      begin
        if p_operator in ('+','-') then
          ret_val := 1;
        elsif p_operator in ('*','/') then
          ret_val := 2;
        elsif p_operator in ('^') then
          ret_val := 3;
        elsif p_operator in ('(') then
          ret_val := 0;
        elsif p_operator in (')') then
          ret_val := 0;
        else
          ret_val := 4;
        end if;
        return ret_val;
      end;
    
      function evaluate_operation(p_left in varchar2,p_right in varchar2,p_operator in varchar2) return number is
        ret_val number := to_number(null);
      begin
        if p_operator = '+' then
          ret_val := to_number(p_left) + to_number(p_right);
        elsif p_operator = '-' then
          ret_val := to_number(p_left) - to_number(p_right);
        elsif p_operator = '*' then
          ret_val := to_number(p_left) * to_number(p_right);
        elsif p_operator = '/' then
          ret_val := to_number(p_left) / to_number(p_right);
        elsif p_operator = '^' then
          ret_val := power(p_left,p_right);
        end if;
        return ret_val;
      end;
    
      procedure treat_operand(p_char in varchar2) is
      begin
        operand_stack := operand_stack || p_char;
      end;
    
      procedure treat_operator(p_char in varchar2) is
        done boolean := false;
        result number;
      begin
        if num_in then
          push_stack(operand_stack,'');
          num_in := false;
        end if;
        while not done loop
          if is_empty(operator_stack) or p_char = '(' then
            push_stack(operator_stack,p_char);
            done := true;
          else
            top_operator := peek_stack(operator_stack);
            if precedence(p_char) > precedence(top_operator) then
              push_stack(operator_stack,p_char);
              done := true;
            else
              top_operator := pop_stack(operator_stack);
              if top_operator = '(' then
                done := true;
              else
                right_operand := pop_stack(operand_stack);
                left_operand := pop_stack(operand_stack);
                result := evaluate_operation(left_operand,right_operand,top_operator);
        dbms_output.put_line('evaluate operation: ('||left_operand||')'||top_operator||'('||right_operand||') = '||to_char(result));
                push_stack(operand_stack,to_char(result));
              end if;
            end if;
          end if;
        end loop;
      end;
    
    begin
      if substr(w_expression,1,1) = '-' then
        w_expression := '0' || w_expression;
      elsif substr(w_expression,1,1) = '+' then
        w_expression := substr(w_expression,2);
      end if;
      w_expression := replace(replace(w_expression,'(-','(0-'),'(+','(');
      while true loop
        next_char := substr(w_expression,i,1);
        dbms_output.put_line('loop next_char('||to_char(i)||') = '''||next_char||'''');
        exit when next_char is null;
        if next_char in ('0','1','2','3','4','5','6','7','8','9',',') then -- ',' = decimal point !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
          treat_operand(next_char);
          num_in := true;
        elsif next_char in ('+','-','*','/','^','(',')') then
          treat_operator(next_char);
        end if;
        i := i + 1;
      end loop;
      if num_in then
        push_stack(operand_stack,'');
      end if;
      while not is_empty(operator_stack) loop
        top_operator := pop_stack(operator_stack);
        right_operand := pop_stack(operand_stack);
        left_operand := pop_stack(operand_stack);
        ret_val := evaluate_operation(left_operand,right_operand,top_operator);
        dbms_output.put_line('evaluate operation: ('||left_operand||')'||top_operator||'('||right_operand||') = '||to_char(ret_val));
        push_stack(operand_stack,to_char(ret_val));
      end loop;
      left_operand := pop_stack(operand_stack);
      ret_val := to_number(left_operand);
        dbms_output.put_line('operand_stack = '||substr(operand_stack,1,100));
        dbms_output.put_line('operator_stack = '||substr(operator_stack,1,100));
        dbms_output.put_line(w_expression||' = '||to_char(ret_val));
      if is_empty(operand_stack) and is_empty(operator_stack) then
        return ret_val;
      else
        return to_number(null);
      end if;
    end;
    

    Concerning

    Etbin

    In memory of 'old days' when there was only FORTRAN at the University (no Pascal).

    Edited by: Etbin on 8.6.2009 16:48

  • Query THAT SQL contains the keyword "LIKE".

    Hello

    I want to select 'Id' from 'table' where string begins with "BR" demand is as follows: SELECT the Id OF the table WHERE string LIKE '% BR', it works when I run it in MS Access but when I included in Labwindows CVI, it generates an error (unknown specifier).

    I'm looking for the equivalent of the % character.

    Note:

    Hardware environment: PC DELL Intel Core CPU 2DUO

    Software environment: Labwindows CVI 2010

    Hello

    If you are using sprintf to format the request, the % is the format specifier ==> you must use % in the format string of the format specifier (%)

    sprintf (request, ' SELECT Id FROM table WHERE string LIKE'%'");

    with a string parameter:

    sprintf (request, ' SELECT Id FROM table WHERE string LIKE '%s%'","BR");

  • Methods without papers in the field

    I just stumbled on net.rim.device.api.ui.Field.setPadding (),. setMargin() etc., try know and wondered why these methods are there publicly in the JDE API, but undocumented.

    Are they somehow unwanted/outdated or not supported?

    Is it safe to use? If Yes, on what JDE versions?

    Thanks and regards,

    grzlbrmft

    I'm working for RIM node. Official statement is: don't use them. my own statement is: do it at your own risk.

    I can add a few experiences if you try and you ask nicely, but maybe it won't either satisfy you.

    This is a user to user forum. If you want to support the RIM you can try your luck on [email protected] or buy a support contract official from RIM. Or become a member of the alliance and bask in the infinite wisdom and super quick responses from the support of the alliance (from 4 weeks for ever).

    Sometimes the responses of Mark son here with official statements, but it is especially his one-man show the extent of the official concerned, no claim in this regard.

  • Helps with the syntax of dynamic sql statements

    Hi all
    How can I pass the value of the result of my dynamic select statement to a Ref Cursor?
    I try the following statement but does not work, I get this error:
    ORA-00932: inconsistent data types: expected - was - ORA-06512: at
    Procedure getItems(v_first In number, v_second In Number, arg_Cursor IN OUT CUSTOM_REF_CURSOR) is
         sqlString varchar(3000);
         Begin
           sqlString := 'select* from bla where o.arg_1 = :1 and arg_2 = :2'; 
       
           execute immediate sqlString 
           into arg_Cursor
           using v_first, v_second;
       End getItems;
    Any ideas?
    Thank you

    Johnny
    PROCEDURE getitems (v_first IN NUMBER, v_second IN NUMBER, arg_cursor IN OUT sys_refcursor)
    IS
      sqlstring   VARCHAR (3000);
    BEGIN
      sqlstring := 'select* from bla where o.arg_1 = :1 and arg_2 = :2';
    
      OPEN arg_cursor FOR sqlstring USING v_first, v_second;
    END getitems;
    
  • Keyword not found where expected - in PL/SQL ONLY.

    Hello

    I use Oracle 10.2.0.3 on Windows 7 on laptop using Toad.

    The following SQL code selects the PK and FK views columns DBA.
    It is running very well and gives the desired result.
    WITH temp AS (
    select rownum RN, R_constraint_name pk, constraint_name fk
    from user_constraints 
    where constraint_type = 'R'
    --and table_name = 'EMPLOYEES'
    )
    select pk.tname "PK Table", pk.cname "PK Column", fk.tname "FK Table", fk.cname "FK Column", decode(pk.tname, fk.tname,'Self Join', 'Equi Join') "Join Type"
    from
    (
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.pk
    ) PK,
    (    
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.fk
    ) FK    
    WHERE pk.RN=fk.RN(+)
    ORDER BY 1, 3
    Whenever I put the same query in a PL/SQL block, I get the following error:
    < font color = "red" >
    ORA-06550: line 19, column 44:
    PL/SQL: ORA-00923: KEYWORD not found where expected
    ORA-06550: line 13, column 1:
    PL/SQL: SQL statement ignored
    < / make >


    DECLARE
    
    TYPE OBJ_DETAIL_TYPE IS TABLE OF VARCHAR2(30);
    v_pk_tname    OBJ_DETAIL_TYPE;
    v_pk_cname    OBJ_DETAIL_TYPE;
    v_fk_tname    OBJ_DETAIL_TYPE;
    v_fk_cname    OBJ_DETAIL_TYPE;
    v_join_type   OBJ_DETAIL_TYPE;
    
    BEGIN
    
    --*****************************************************
    WITH temp AS (
    select rownum RN, R_constraint_name pk, constraint_name fk
    from user_constraints 
    where constraint_type = 'R'
    --and table_name = 'EMPLOYEES'
    )
    select pk.tname into v_pk_tname , pk.cname into v_pk_cname, fk.tname into v_fk_tname, fk.cname into v_fk_cname, decode(pk.tname, fk.tname,'Self Join', 'Equi Join') into v_join_type
    from
    (
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.pk
    ) PK,
    (    
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.fk
    ) FK    
    WHERE pk.RN=fk.RN(+)
    ORDER BY 1, 3;
    --*****************************************************
    
    END;
    /
    Surely I'm missing something, a limitation in PL/SQL syntax, perhaps.

    Can someone guide me please on this...

    Thank you in advance.

    Kind regards.

    Here's your resolution:

    Hoping that you will get your solution less change.

    DECLARE
    
    TYPE OBJ_DETAIL_TYPE IS TABLE OF VARCHAR2(30);
    v_pk_tname    OBJ_DETAIL_TYPE;
    v_pk_cname    OBJ_DETAIL_TYPE;
    v_fk_tname    OBJ_DETAIL_TYPE;
    v_fk_cname    OBJ_DETAIL_TYPE;
    v_join_type   OBJ_DETAIL_TYPE;
    
    BEGIN
    
    --*****************************************************
    WITH temp AS (
    select rownum RN, R_constraint_name pk, constraint_name fk
    from user_constraints
    where constraint_type = 'R'
    --and table_name = 'EMPLOYEES'
    )
    select pk.tname, pk.cname, fk.tname, fk.cname, decode(pk.tname, fk.tname,'Self Join', 'Equi Join') bulk collect into v_pk_tname, v_pk_cname, v_fk_tname, v_fk_cname, v_join_type
    from
    (
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.pk
    ) PK,
    (
    select t.rn RN, u.table_name tname, u.column_name cname
    FROM user_cons_columns u, temp t
    where u.constraint_name = t.fk
    ) FK
    WHERE pk.RN=fk.RN(+)
    ORDER BY 1, 3;
    --*****************************************************
    
    END;
    / 
    
    Regards,
    P.
    

Maybe you are looking for

  • Rejection of palm pro iPad does not

    I use the iota dashboard but does not work the rejection of palm and practically impossible to use the ipad for hand writing. Everything was good on the old ipad. With the Apple pencile everything is good Help, please

  • Black screen setting in motion

    Hello, I'm moving my iMac, but I see is a black screen and an icon of white file with the icon of the question about it. What it means? Thank you Anna

  • Problem with the software Modem on Satellite Pro L40

    I tried to set up a connection Dial-Up Networking on a Satellite Pro L40 running Vista and can't get the modem to talk to the modem from the ISP. The connection appears OK and then you can hear the modem dial, but when the ISP picks up there is a bit

  • HP ProBook 4510 s power problem

    I have a ProBook 4510 of s. This morning he was in battery operation. Battery charge with the AC adapter is plugged in. Only a battery with flashing red x icon. Once the battery is depleted it would boot is no longer. I took out the battery and held

  • Having trouble making a repair, then activating the product key

    Intel core 2 duo with a card mother asrock, the coa and the XP sp3 disc. I wanted to do a repair, because the system restore did not work.  Not so simple.  Need administrator authority, but did not know the password.  checked some forums and the admi