Calling a procedure with IN and OUT parameters

Hello

I usually call my procedures using the following

declare the variable msg_erreur varchar2 (50)
exec simple_msg('ABC,'ABC','ABC',:error_msg);

CREATE OR REPLACE PROCEDURE SIMPLE_MSG)
ID IN VARCHAR2,
URL IN VARCHAR2,
THE LIST IN VARCHAR2,
MSG_ERREUR OUT VARCHAR2

*************************************************************
Now my question is, I try to call a proc that has IN OUT parameters. Can someone guide me on how to call the d.a. thanks

CREATE OR REPLACE PROCEDURE SIMPLE_MSG)
ID IN VARCHAR2,
URL IN VARCHAR2,
THE LIST IN VARCHAR2,
NAME IN VARCHAR OUT,
MSG_ERREUR OUT VARCHAR2

Hello

OUTSIDE of the parameters are passed as OUT was: you must pass a variable.

If you set the IN OUT parameter before calling the procedure, and then either
(a) use the separate EXEC command:

EXEC  :name := 'Original name';
EXEC  simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);

or

(b) use a PL/SQL anonymous block, like this:

BEGIN
    :name := 'Original name';
    simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);
END;
/

The parameter can be either a variable binding (as illustrated above), or a local variable (which may only be used in the block).

Tags: Database

Similar Questions

  • Procedure with IN and OUT parameters of date

    Hello guys,.
    could you please tell me where I am doing wrong, I want to obtain or return the date of the procedure below. He throws under error when I try to run it, appreciate your help.

    Execute the statement:
    exec get_nxt_trd_dt('09/03/2010')

    Error message:
    PLS-00306: wrong number or types of arguments in the call to 'GET_NXT_TRD_DT '.

    The body of the procedure:
    CREATE OR REPLACE PROCEDURE GET_NXT_TRD_DT
    (INPUT_DT IN DATE, OUTPUT_DT DATE) IS

    BEGIN
    SELECT MIN (DATES) IN OUTPUT_DT (SELECT DIFFERENT DATES OF)
    SELECT * FROM
    (
    SELECT TRUNC (TO_DATE (TO_CHAR (SYSDATE, 'YYYYMMDD'), 'YYYYMMDD'), 'Y') + ROWNUM-1 DATES FROM
    (
    SELECT 1
    OF the double
    GROUP BY CUBE (2, 2, 2, 2, 2, 2, 2, 2, 2)
    )
    WHERE ROWNUM < = ADD_MONTHS (TRUNC (TO_DATE (TO_CHAR (SYSDATE, 'YYYYMMDD'), 'YYYYMMDD'), 'Y'), 24)-TRUNC (TO_DATE (TO_CHAR (SYSDATE, 'YYYYMMDD'), 'YYYYMMDD'), 'Y')
    )
    WHERE TO_CHAR (DATES, "DY") NOT IN ("SAT", "SUN")
    LESS
    SELECT HOLIDAY_DATE SEPARATE HOLIDAY)
    WHERE WAS BETWEEN TO_DATE('08/01/2010','MM/DD/YYYY') AND TO_DATE('09/30/2010','MM/DD/YYYY')
    )
    WHERE DATES > TO_DATE(INPUT_DT,'MM/DD/YYYY');

    END;

    Try this:

    DECLARE
      dt date;
    BEGIN
      get_nxt_trd_dt(to_date('09/03/2010', 'dd/mm/yyyy'), dt );
      dbms_output.put_line( dt );
    END;
    /
    
  • How to call a procedure with parameter SYS_REFCURSOR OUT

    Hello

    With the help of Oracle 11 g R2.

    I would like to know if it is possible to display the results of a SYS_REFCURSOR in a query. For example, if I had the following stored procedure

    
    create or replace procedure testprocedure (result OUT sys_refcursor)
    as
    begin
       open result for
          select 1 from dual
          union all
          select 2 from dual;
    end;
    
    

    I want to call this procedure similar to how a query is called and executed. Like this

    Select * from testprocedure

    I have seen lots of examples on the web that show how it is possible to loop through the results of a sys_refcursor inside an anonymous block and display the results using dbms_output.putline, but this isn't the method I'm looking for.

    Read this: PL/SQL 101: understanding Ref Cursor

    You're wrong if you think a ref cursor is a result set of data that you can query from.

  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • Calling stored procedure with an input of DATE parameter

    Hello. A question about the Date input parameters when you call a stored procedure.

    I have a procedure that takes a DATE as input parameter. I would DATE this value to include a time element.

    My Application Module method takes an input as a java.util.Date (myParamDate) parameter - that will preserve a time element (?).

    However when I create the CallableStatement, I am trying to set the parameter using setDate like this (for the param 5):
                st = getDBTransaction().createCallableStatement("begin cs_my_pck.request_values(?,?,?,?,?,?,?,?); end;", 0);            
                Connection myConn = st.getConnection();
                ArrayDescriptor myArrDesc  =  ArrayDescriptor.createDescriptor("CS_FIELD_TABT", myConn);
                Array sqlParamNameArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramNames.toArray());
                Array sqlParamValueArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramValues.toArray());
                Array sqlFilterNameArray = new oracle.sql.ARRAY(myArrDesc,myConn,filterNames.toArray());
                    
                st.setString(1, repType);
                st.setObject(2, sqlParamNameArray);
                st.setObject(3,sqlParamValueArray);
                st.setObject(4,sqlFilterNameArray);
    
                java.sql.Date myRepDate = new java.sql.Date(myParamDate.getTime());
    
                st.setDate(5,myRepDate);
                
                System.out.println("Report Date = " + myRepDate.toString());
                st.setString(6,repUser);
                st.setString(7,repAttach);
                // set out param
                st.registerOutParameter(8, Types.NUMERIC);
                st.execute();
    I understand java.sql.Date does NOT include a time element. But setDate() only accepts a java.sql.Date so my parameter of the procedure ends with a zero time element.

    How to call this procedure keeping the time element?

    Thank you.

    It includes the time element, if you want more precision with time stamp.

    http://docs.Oracle.com/javase/6/docs/API/Java/SQL/date.html

  • How to call a procedure with two arguments.

    Hello
    I have a procedure with two arguments, IE. MyProcedure (p1 in numbers, p2 in number) to display an image blob.
    How can I call this image blob in the url.
    I tried http://127.0.0.1:7777/pls/apex/SCHEMA.myprocedure?p1=1 & p2 = 2, but it does not work...
    Thank you
    Vincent

    Vincent,

    As long as you've got the possibility to execute the procedure and there is no space in the url and you have not misspelled the names of parameters then it looks right.

    Here is a link to a procedure to download a file that takes two parameters.

    http://mywebsite.com/pls/htmldev/schema.package.function.download_file?p_session_id=1221970786026206&p_seq_id=724

    See you soon,.

    Janet Tyson

  • Calling a SQL function which has Out parameters

    Hello people,
    I don't know if it's feasible, but here's my scenrio at hand. I have a database function that accepts a few parameters AND OUTPUT parameters. I want one Out to display in my select statement parameters. Is this possible?

    Thank you

    No you can not use a function with out parameters in sql statements.

    If possible do the function of this return value, use it in select. (imean instead of the parameter, OUT out which parameter through the BACK)

    G.

  • What is the syntax to call a procedure with named parameters?

    I should know this, but I can't seem to remember how to do it and did not find reference.

    If I have a procedure like this:

    CREATE or REPLACE myProc (inParam1 IN VARCHAR2, inParam2 in NUMBERS)...

    If I want to call this stored proc with a call control and the name of the parameters instead of having to go through position, how should I do that?

    That is to say, I know that I can do: call the myProc('somevalue'1)

    But I want to be able to do something like this: call myproc (inParam1: = "somevalue", inParam2: = 1)-which doesn't seem to work. Anyone know the syntax I'm looking for?

    Thank you!

    I don't know if you are referring to the call to the procedure according to the parameters.

    His

    Call MyProc (inParam1-online "somevalue", inParam2-online 1)

    call MyProc (inParam2-online 1, inParam1-online "somevalue")

    Hopefully it's that you make reference to.

  • Call Oracle procedure with variable

    Experts,

    I pass arguments through script to Oracle procedure, use the input value and pass to the procedure.

    Oracle procedure Gets the input value, run the query, and all connect to the log file.

    I am facing a few challenges, seems to be the error of syntax or data type

    1. even if I pass all the script parameter still run complains of wrong number or type of arguments.

    There are three numbers followed by a date variable

    2. how to pass a variable value with the INTERVAL function, it should take the value of the variable lThird for example "" AND date > = date + INTERVAL '30' MINUTE; "but somehow, after trying different variants still get error like interavl not valid."

    3 see someone more changes to this?

    ! / bin/ksh

    $1 = 10;

    $2 = 30;

    3 = $50

    $4 = '20150113';

    echo "Oracle procedure in progress"

    (

    set linesize 100

    pkg.proc exec ($1, $2, $3, $4);

    ) > $logFile

    If [$? == 0]

    then

    EXIT_VAL = 0

    = Package/oracle procedure =.

    CREATE or REPLACE PACKAGE pkg

    AS

    procedure proc (lFirst in number,

    lSecond in numbers

    lThird in numbers

    date IN oven,

    curReturn to sys_refcursor);

    Pkg of END;

    /

    CREATE or REPLACE PACKAGE pkg BODY

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird in numbers

    date IN oven,

    curReturn ON sys_refcursor)

    IS

    BEGIN

    OPEN FOR CurReturn

    SELECT date,

    emp_id,

    first name,

    last_name

    Employees

    WHERE Emp_id in (lFirst, lSecond)

    Date AND > = date + MINUTE INTERVAL "(lThird)"

    AND date = TO_DATE (oven, 'YYYYMMDD')-1;

    END proc;

    Pkg of END;

    /

    Error:

    PLS-306: wrong number or types of argument in the call to proc

    Hello

    With regard to your needs:

    My current problem is

    1. how to store the SELECT results in the log file, ask has several columns with multiple lines

    2. what happens when SELECT brings out no line?

    I have re-used, corrected and adapted to your procedure:

    Package:

    CREATE or REPLACE PACKAGE pkg

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird IN varchar2,

    curReturn to sys_refcursor);

    Pkg of END;

    /

    CREATE or REPLACE PACKAGE pkg BODY

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird IN varchar2,

    curReturn ON sys_refcursor)

    IS

    BEGIN

    OPEN FOR CurReturn

    SELECT *.

    WCP

    WHERE empno in (lFirst, lSecond)

    AND hiredate > = TO_DATE (lThird, 'YYYYMMDD');

    END proc;

    Pkg of END;

    /

    Shell script: test_sql.sh

    #! / bin/ksh

    V_user = scott

    V_pass = Tiger

    echo "Oracle procedure in progress"

    Req ='sqlplus-s $V_user / $V_pass<>

    var refcursor rc

    exec pkg.proc ($1, $2, $3,: rc)

    print the rc

    output

    EXPRESSIONS OF FOLKLORE"

    echo "$req" > logfile$ $

    PS:

    (1) you must put the name of your user/passwd name and table (I used the scott/tiger schema by default with emp table). This is just to show how to retrieve a refcursor output in a script.

    (2) I used logfile$ $ as output file; You can use any other file or method name to redirect the output to a file

    Call us at:

    19000101 7934 7900 test_sql.sh

    PS: As noted in the previous posts, you cannot define a VARIABLE of type DATE in sqlplus (or a Unix script); You can send a string and perform the conversion in the SQL section.

    If no line is not recovered, you get the following in the log file:

    PL/SQL procedure successfully completed.
    
    no rows selected
    

    HTH.

  • calling a procedure with nested table as input param type

    Hello

    I have a guy like that table.

    create or replace type table_type like table of the varchar2 (4000);

    I have a procedure like this.

    proc_temp (v_table_type, table_type)

    Start

    key code...

    end;


    I have a table like this.

    tab_test_data

    --------------------

    ABCD

    efghd

    MNOP

    XYXX

    I want to move this data in table tab_test_data as param of entry while calling this proc could you please tell me how the procedure that calls the statement will be the writtern.

    I try like this.

    ----------------------------

    declare

    TABLE_TYPE v_table;

    Start

    proce_temp (v_table); - here, I want to pass data to the table as entry

    end;

    /

    You already have the data in a table (tab_test_data), then why don't you just use the table inside the proce_temp? Why should I set a collection type and pass it as a parameter? Collections use the expensive PGA memory. If the application that you build this way may have some serious scalability issues.

    Sort of a technical solution would be like this. You can use BULK COLLECT.

    declare
    TABLE_TYPE v_table;
    Start
    Select to bulk column_name fired in v_table
    of tab_test_data;

    proce_temp (v_table);
    end;
    /

  • How 2 call a procedure with the data type for the parameter Ftree.NODE

    Hello

    in this link
    http://Andreas.Weiden.ORCL.over-blog.de/article-29307730.html


    Down in the page after you run the package, I created the procedure and it compiled successfully but when call PR_WTNS in trigger WHEN-TREE-NŒUD-SELECTED

    PROCEDURE PR_WTNE (i_ndNode IN Ftree.NODE);

    as

    PR_WTNE (i_ndNode Ftree.NODE);


    I got the error message; A wrong number or types of argument in the call

    pls I'm stuck can help any one?


    Kind regards

    Abdetu...

    Published by: Abdetu on October 24, 2010 02:36

    Published by: Abdetu on October 24, 2010 02:36

    YKou have to give a variable of type Ftree.NODE when calling this function. If called fromm a WHEN-TREE-NODE-SELECTED-trigger, use: SYSTEM. TRIGGER_NODE

  • Calling shell script program SQL and passing parameters

    Hi guys,.
    Greetings from Toronto. Is it possible to move one or more strings as parameters to a sql from shell script program?

    Shell script
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
     
    sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    SQL program (rd_test.sql)
    -- Accept system input parameters
    define p_user_id = &1
    define p_job_id = &2
    
    -- Wondering if its possible to pass these 3 parameters from a shell script program.
    -- (1) rd_test-$p_job_id-3-1.lis
    -- (2) RD_PRINTER(rd_test,3)
    -- (3) t_data
    
    select
    t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    t_data_dir=''.''
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'
    exit_status=$?
    check_command'
    from rd_job_parameter b, rd_job_parameter a
    where a.job_id = &2
    and a.jp_module_id = 'RDTEST'
    and b.job_id = a.job_id
    and b.module_id = a.module_id
    /
    As always, this is not something I have to solve that minute. Any help would be appreciated
    and I will think of the problem.

    Thank you
    REDA

    Published by: Raj404261 on June 25, 2009 11:40

    Published by: Raj404261 on June 25, 2009 17:29

    OK, just a few pointers possible if you need to go the way of shell script.

    I suggest that you have a separate SQL script for each of your options, which retains the fairly well-defined lines and keeps the maintenance as simple as possible. Therefore, in your shell script, you can have something like:

    #!/bin/ksh
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    
    # Deduce which script you'll call here
    # using if statements, or even a case:
    
    if [[ p_job_id -eq 1 ]]
    then
      SQL_SCRIPT=sql_script1.sql
    else
      SQL_SCRIPT=sql_script2.sql
    fi
    
    # Or using case
    
    case $2
      in
        1)     SQL_SCRIPT=sql_script1.sql;
    
        2)     SQL_SCRIPT=sql_script2.sql;
    
        3)     SQL_SCRIPT=sql_script3.sql;
    
        *)     SQL_SCRIPT=sql_script4.sql;
    esac
    
    export ${SQL_SCRIPT}
    
    #If you need to query the database at all to deduce which script to cal
    #Then something like this:
    
    SCRIPT_VAR=`sqlplus -s username/password << EOF
    set heading off
    set feedback off
    set verify off
    SELECT * FROM DUAL;
    EOF`
    
    export {SCRIPT_VAR}
    
    SQL_SCRIPT=sql_script${SCRIPT_VAR}.sql
    
    # Then just call your script:
    sqlplus. -s $p_user_id/password @${SQL_SCRIPT}
    
  • Run the statement in a stored procedure with Out parameters and

    Hi all

    I have a stored procedure that calls a select statement. Here it is...

    CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE

    * (BLABLA_KEY IN NUMBER, *)
    XML_OUTPUT ON VARCHAR)
    AS
    BEGIN
    SELECT SYS. XMLTYPE.getStringVal (OBJECT_VALUE) in XML_OUTPUT FROM BLABLA_VIEW WHERE extractValue (OBJECT_VALUE, ' / BLABLA_TYPE/BLABLA_KEY ') = 2876;
    END;

    Is to have both IN and OUT parameters as described above. I am able to compile and run the procedure.

    The problem I want to share with everyone is...
    I want to run the stored procedure together with a single EXEC command.

    I tried different ways using the EXEC command but of no use.

    Could someone help me?
    Thanks in advance.

    Published by: user10763276 on June 3, 2010 15:47

    Please visit the following...

    sudhakar@ORCL>CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
      2  (BLABLA_KEY IN NUMBER,
      3  XML_OUTPUT OUT VARCHAR)
      4  AS
      5  BEGIN
      6  XML_OUTPUT := BLABLA_KEY || ' and whatever else...';
      7  END;
      8  /
    
    Procedure created.
    
    sudhakar@ORCL>
    sudhakar@ORCL>var XML_OUTPPUT varchar2(100);
    sudhakar@ORCL>exec BLABLA_VIEW_PROCEDURE (9151, :XML_OUTPPUT);
    
    PL/SQL procedure successfully completed.
    
    sudhakar@ORCL>print XML_OUTPPUT;
    
    XML_OUTPPUT
    --------------------------------------------------------------------------------
    9151 and whatever else...
    
    sudhakar@ORCL>
    

    Post tells you...

    var OUTPUT VARCHAR
    exec BLABLA_VIEW_PROCEDURE (9151, :OUTPUT);
    print OUTPUT
    

    VARCHAR is not a valid TYPe to declare. Use VARCHAR2 (nnn) where nnn is a number.
    VR,
    Sudhakar B.

  • Call the PL/SQL procedure with in out parameter of OIC clob

    Hello

    For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).

    I use a pl/sql problem test procedure:

    create or replace function Test (longField outside clob) return number is
    Number of result;
    Start
    longField: = 'prefix ';
    Result: = 12;
    Return (result);
    end Test;

    So I do all the stuff with the connection to the DB,

    I prepare the statement: "start: res: = test(:param); end; »
    So I OCIHandleAlloc (m_pCtx-> hpEnv,
    (void *) & m_hpStatement,.
    OCI_HTYPE_STMT,
    0,
    (NULL);
    and
    OCIStmtPrepare (m_hpStatement,
    m_pCtx-> hpErr,
    (...),
    (...),
    OCI_NTV_SYNTAX,
    OCI_DEFAULT);

    Before the binding I prepare parameters. For a clob I devote to the lob Locator:

    OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
    (ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
    OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);

    that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.

    I get an error
    ---------------------------
    Microsoft Visual C++
    ---------------------------
    Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.

    My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
    If Yes, what steps I need to do to succeed?

    Thank you for your response.

    Hello

    Of course, it is possible :)

    Show that you are your piece of code that is binding.
    Are you sure you had correctly the lob descriptor in the call to bind?

  • How to get 2 out of procedure with sql dynamic param?

    Hello

    following my other question on the treatment in the ranks, so that I did a procedure defined ranges for the table I want to deal with;

    I did another procedure to obtain a particular range for treatment and that's where I have a problem;

    My data are:

    {

    CREATE THE TABLE PRECUBE. TEST_STG_TMO_RANGES

    (

    NUMBER OF GLASS FIBER,

    MIN_RID VARCHAR2 (18 BYTE),

    MAX_RID VARCHAR2 (18 BYTE)

    )

    tablespace UTI_DAT;

    Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (0, 'AABKSxAAEAACW3pAAA', 'AABKSxAAEAADqCICcQ');

    Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (1, "AABKSxAAEAADqCJAAA", "AABKSxAAEAAD + wICcQ");

    Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (2, ' AABKSxAAEAAD/QJAAA', 'AABKSxAAEAAECyICcQ');

    Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (3, 'AABKSxAAEAAEFQJAAA', 'AABKSxAAEAAEL8ICcQ');

    Insert into TEST_STG_TMO_RANGES (GRP, MIN_RID, MAX_RID) values (4, 'AABKSxAAEAAEMSJAAA', 'AABKSxAAEAAEPwICcQ');

    }

    my package:

    {

    create or replace
    PACKAGE C_UTI_BASIC AS
    procedure P_GET_RANGE (table_owner_in in varchar2
    TABLE_NAME_IN in varchar2
    range_no number
    Min_RANGE_OUT OUT varchar2
    max_range_OUT OUT varchar2
    );

    END C_UTI_BASIC;

    }

    My procedure:

    {

    procedure P_GET_RANGE (TABLE_OWNER_IN in varchar2
    TABLE_NAME_IN in varchar2
    RANGE_NO number
    MIN_RANGE_OUT OUT varchar2
    MAX_RANGE_OUT OUT varchar2
    )
    is

    DDL_STATEMENT varchar2 (4000);

    Start

    DDL_STATEMENT: ='select MIN_RID, MAX_RID in MIN_RANGE_OUT, MAX_RANGE_OUT in '. TABLE_OWNER_IN |'. ' || TABLE_NAME_IN | "_RANGES where PRV =' | RANGE_NO;

    immediately run DDL_STATEMENT;
    DBMS_OUTPUT. PUT_LINE (DDL_STATEMENT);
    DBMS_OUTPUT. Put_line ('Min_RANGE_OUT :'||) Min_RANGE_OUT);
    DBMS_OUTPUT. Put_line ('max_range_OUT :'|| max_range_OUT);
    end P_GET_RANGE;

    }

    I tried to call the procedure with:

    {

    declare

    V_MIN_RANGE_OUT varchar2 (30);

    v_Max_RANGE_OUT varchar2 (30);

    Start

    C_UTI_BASIC. P_GET_RANGE (TABLE_OWNER_IN = > 'PRECUBE')

    , TABLE_NAME_IN = > 'TEST_STG_TMO '.

    , RANGE_NO = > '4'

    , MIN_RANGE_OUT = > V_MIN_RANGE_OUT

    , MAX_RANGE_OUT = > v_Max_RANGE_OUT

    );

    end;

    }

    but it ends with the error:

    Error report:

    ORA-06510: PL/SQL: not supported by the user-defined exception

    ORA-06512: at "DWH_ADMIN. C_UTI_BASIC', line 2331

    ORA-00905: lack of keyword

    ORA-06512: at line 5

    06510 00000 - "PL/SQL: not supported by the user-defined exception.

    * Cause: A user-defined exception has been raised by PL/SQL code, but

    not been processed.

    * Action: Fix the problem that causes the exception or write an exception

    Manager for this condition. Or you may have to contact your

    Director of application or DBA.

    When I jump the "run immediately" just to see what is output through DBMS output here it is:

    {

    Select MIN_RID, MAX_RID in MIN_RANGE_OUT, PRECUBE MAX_RANGE_OUT. TEST_STG_TMO_RANGES where PRV = 4

    Min_RANGE_OUT:

    max_range_OUT:

    }

    the select statmetent seems OK for me, but the parameters are not met and have the value null;

    I would appreicate advice on where I went wrong here and how achieve a correct output

    THS

    Rgds

    Rgds

    Outside the use of SQL statements cr@p Dynamics (i.e. DML and not the DDL as implied by your code) and your total lack of variable bind...

    And that is your problem.  Your dynamic instruction seeks to select VARIABLES that are out of reach of the dynamic statement itself.  The IN such statements should be part of the EXECUTE IMMEDIATE for example

    EXECUTE IMMEDIATE ddl_statement INTO min_range_out, max_range_out;

Maybe you are looking for