Using OUT Parameters from a Procedure in APEX

Dear All,
Is it possible to create a Process where I can execute a database procedure like:
begin
set_details (:P1_ITEM1, :P1_ITEM2, :P1_ITEM3, :P1_ITEM4);
end;The specification of the above function is like
set_details (:P1_IN1      IN     NUMBER,
                  :P1_OUT1   OUT NUMBER.
                  :P1_OUT2   OUT VARCHAR2,
                  :P1_OUT3   OUT DATE);Thanks & Regards
Arif Khadas

Hi,
Ok,
Try
declare
l_p_2 NUMBER;
l_p_3 VARCHAR2;
l_p_4 DATE;
begin
set_details (:P1_ITEM1, l_p_2, l_p_3, l_p_4);
:P1_ITEM2 := l_p_2;
:P1_ITEM3 := l_p_3;
:P1_ITEM4 := l_p_4;
end;And make sure you do not have process or branch that clear cache
Regards,
Jari
Edited by: jarola on Apr 12, 2011 12:19 PM

Similar Messages

  • I am facing a problem in passing multiple values as out parameters from fo

    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.

    user9041629 wrote:
    Hi All,
    i am facing a problem in passing multiple values as out parameters from for loop.
    EX:
    i have a select statment inside a loop like.....
    PACKAGE SPEC:
    create or replace PACKAGE EMP_PKG AS
    TYPE TAB_NUM IS TABLE OF SCOTT.EMP.EMPNO%TYPE;
    TYPE TAB_NAME IS TABLE OF SCOTT.EMP.ENAME%TYPE;
    TYPE TAB_JOB IS TABLE OF SCOTT.EMP.JOB%TYPE;
    temp_table TAB_NUM;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB);
    END EMP_PKG;
    PACKAGE BODY:
    create or replace PACKAGE BODY EMP_PKG AS
    v_e_no NUMBER;
    procedure test(temp_TAB_e_no OUT TAB_NUM,
    temp_TAB_e_name OUT TAB_NAME,
    temp_TAB_e_job OUT TAB_JOB) IS
    BEGIN
    select EMPNO bulk collect into temp_table from emp;
    for i in 1..temp_table.count loop
    v_e_no := temp_table(i);
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    end loop;
    end test;
    END EMP_PKG;
    PROBLEM FACING IS:
    I am expecting all rows returning from bellow select statment ...
    select empno,
    ename,
    job
    into temp_TAB_e_no(i),
    temp_TAB_e_name(i),
    temp_TAB_e_job(i)
    from emp
    where empno = v_e_no;
    But,while running the SP , i am getting error like
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SCOTT.EMP_PKG", line 16
    why i am not getting all values as out parameters.please provide a solution for me.
    Thanks in advance my friend.Probably not a bad thing that this isn't working for you.
    This is a horrible way to return the contents of a table.
    Are you doing this for educational purpose, or ... what is your goal here? If you just want to return a result set to a client you'd want to look in to using a REF CURSOR and not a bunch of arrays combined with horribly procedural (slow) code.

  • How to get multiple out parameters from a pl/sql stored procedure in ADF Jdeveloper 11g release2

    I´m trying to call from AppModuleImpl a stored procedure from my oracle DB which receives one input parameter and returns 5 out parameters. 
    I´m using jdeveloper 11g release2  ADF and I have created a java bean "ProRecallPlatesBean " with the atributes and accesors and I serialize it. just like in this article http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvgen.htm#sm0297
    This is my code so far:
    public ProRecallPlatesBean getCallProRecallPlates(String numPlates) {
    CallableStatement st = null;
    try {
              // 1. Define the PL/SQL block for the statement to invoke
              String stmt = "begin CTS.Pk_PreIn.proRecallPlates(?,?,?,?,?,?); end;";
              // 2. Create the CallableStatement for the PL/SQL block
              st = getDBTransaction().createCallableStatement(stmt,0);
              // 3. Register the positions and types of the OUT parameters
              st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.VARCHAR);
    st.registerOutParameter(4,Types.VARCHAR);
    st.registerOutParameter(5,Types.VARCHAR);
    st.registerOutParameter(6,Types.VARCHAR);
    // 4. Set the bind values of the IN parameters
    st.setString(1,numPlates);
    // 5. Execute the statement
    st.executeUpdate();
    // 6. Create a bean to hold the multiple return values
    ProRecallPlatesBean result = new ProRecallPlatesBean();
    // 7. Set values of properties using OUT params
    result.setSpfVal(st.getString(2));
    result.setTransportTypeVal(st.getString(3));
    result.setTransportCompanyVal(st.getString(4));
    result.setCompanyDescrVal(st.getString(5));
    result.setDGAPrint(st.getString(6));
    // 8. Return the result
    return result;
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 9. Close the JDBC CallableStatement
    st.close();
    catch (SQLException e) {}
    In Jdeveloper I went into AppModule.xml JAVA>Client Interface section and expose "getCallProRecallPlates" Then I can see "getCallProRecallPlates" in Data Controls, I drag and drop it to a JSF page, an input text component and a button are generated in order to put in there the procedure input parameter (numPlates).
    I don't know if I'm on the right track.
    When I click the button, the "result" variable is supposed to be filled with data from the stored procedure. I want each of those values to be displayed in Output text or input text adf components but I dont know how. Thank you very much in advance I´m a newbie and i'll appreciate your help!

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • Crystal Reports 9 and Stored Procedures using supplied parameters from user

    Hi,
    I have a Crystal Reports 9 report that prints and works fine.  It requests from the user 2 pieces of data which both are String data and not nulls.  I want to use the same report in a Visual Basic.Net 2003 program.  I can pull the report onto the form and it runs wonderfully.  I want to make it run programatically with out prompting for the user to key in the parameters.  I can supply them from an existing data file.  I have tried many things but have lacked the solution. 
    How can I pass the parameters from VB.Net 2003 to the stored procedure which runs the Crystal Report with in the VB.Net 2003 program.
    I appreciate all help and comments.
    Can this be done or do I need to just re-write the report in VB.Net 2003?
    Thanks,
    Norman

    Hi, Norman;
    It sure is possible to pass parameters to a Stored Procedure via our .NET SDK.
    Have a look at these samples:
    https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/9043bbbc-ae66-2b10-ce96-b48f9e25a450
    There are samples showing passing parameters.
    Regards,
    Jonathan

  • Problem with IN OUT parameters whiloe calling procedure from Form 6i

    Hi
    Could some help please? I have the following scenario.
    I am calling a stored procedure from form 6i by pressing a button on the form. Procedure has two IN OUT parameters, and I am passing these two IN OUT parameters and have declared them the way they are declared passed to the procedure. But I get an error when calling that procedure with these IN OUT parameters. the procedure works fine if parameters are IN only. The error says:
    PLS:00363: Expression '1' cannot be used as an assigment target.
    NO matter I pass some value or leave it blank, I get the same error message persistenetly.
    Please help.
    Thanks

    make sure you are calling your procedure with variables as parameters,
    i.e.
          l_v1 := 1 ;
          l_v2 := 'hello world' ;
          your_proc(l_v1, l_v2)
    not
          your_proc(1,'hello world')

  • IN OUT parameters in Stored Procedures

    can anybody explain in detail what is in and out parameters in oracle stored procedures.
    thanks in advance

    IN is used to specify parameters that are input to the stored procedures. OUT is used to specify parameters that can be returned from the stored procedures.
    Please don't get confused with procdures returning value.. You don't need to write a return statement.. just assigning the values to OUT parameters is good ebnough to retireve there values outside stored procedures.
    Hope it helps.

  • Cannot get OUT parameter from stored procedure

    Hi,
    I am new to stored procedure programming. I wrote a simple java stored procedure as follows:
    package fvt;
    import java.sql.*;
    import java.io.*;
    public class FVTProcedures
    extends COM.ibm.db2.app.StoredProc {
    public void addRecord(int id, String name, int status)
    throws SQLException {
    java.sql.Statement stmt = null;
    java.sql.Connection con = null;
    PrintWriter pw = null;
    try {
    status =3;
    pw = new PrintWriter(new FileWriter("c:/temp/fvtproc.txt"));
    pw.println("starting...");
    // get connection
    con =getConnection();
    pw.println("Got connection");
    stmt = con.createStatement();
    stmt.execute("INSERT INTO cmtest (id, name) values (" + id + ",'"+name+"')");
    pw.println("Inserted the record");
    if (!con.getAutoCommit()) {
    con.commit();
    pw.println("Committed the connection");
    catch (SQLException sqle) {
    pw.println(sqle.getMessage());
    catch (Exception e) {
    pw.println(e.getMessage());
    finally {
    status =2;
    pw.close();
    try {
    if (stmt != null) {
    stmt.close();
    catch (SQLException sqle) {}
    try {
    if (con != null) {
    con.close();
    catch (SQLException sqle) {}
    Then I use the following sql command to create this stored procedure, especially register status as OUT parameter.
    CREATE PROCEDURE addRecord (IN id INT, IN name VARCHAR(20), OUT status INTEGER)
    FENCED LANGUAGE JAVA EXTERNAL NAME 'fvt.FVTProcedures!addRecord' PARAMETER
    STYLE DB2GENERAL
    My java program calling this stored proc is as follows:
    import java.sql.*;
    import javax.sql.*;
    public class CallableStmtTest {
         COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource ds = null;
         public static void main(String args[]) {
              CallableStmtTest dt = new CallableStmtTest();
              try {
                   dt.test();
              } catch (Exception e) {
                   e.printStackTrace(System.out);
         public CallableStmtTest() {
              ds = new COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource();
              ds.setUser("username");
              ds.setPassword("password");
              ds.setDatabaseName("database");
    public void test() {
    java.sql.Connection conn = null;
    CallableStatement cs = null;
    String sql = "CALL ADDRECORD(?, ?, ?)" ;
    try {
    conn = ds.getPooledConnection().getConnection();
    conn.setAutoCommit(false);
    System.out.println("Got the connection");
    cs = conn.prepareCall( sql ) ; /* con is the connection */
    System.out.println("Callable statement is prepared");
    cs.registerOutParameter(3, java.sql.Types.INTEGER);
    cs.setInt(1, 1001 );
    cs.setString(2, "1001");
    cs.execute() ;
    System.out.println("Callable statement is executed, return status: "+cs.getInt(3));
    conn.commit();
    catch(SQLException sqle) {
    sqle.printStackTrace();
    finally {
    try {
    if (cs!=null) {cs.close();}
    catch (SQLException sqle1) {
    try {
    if (conn!=null) {conn.close();}
    catch (SQLException sqle1) {
    However, the out put is always
    Callable statement is executed, return status: 0
    while i expect to be
    Callable statement is executed, return status: 2
    Can anyone tell me what's wrong with that?
    thansk,
    JST

    public void addRecord(int id, String name, int status)
    throws SQLException {
    status =3;In regular java you are never going to see this value (3) outside of that method. Java doesn't work that way.
    So unless java inside the DB works really differently from regular java, you are going to have to pass something else.

  • How to retreive out parameters from function in sql statement

    hi dear,
    Suppose i have a fuction with two "out" parameters, i want to show the values of these paramenters in sql stm.
    like
    select my_function() from dual;
    Thanx

    Can't be done. To use a function in SQL it can only have a single return value.
    Try something like this changing the data types appropriately.
    var x number
    var y number
    var z number
    exec :x := my_function(:y, :z)
    print

  • How do I use the Parameters from URL to filter on Content Query in ItemStyle.xsl?

    Hi, I might need your help with code that Content Query under <xsl:Template...> that I need a filter for 3 parameter from url (from date, to date(for date range) and type.
    eg: www.mywebsite.com/pages/Filter.aspx?DateFrom=01/01/2012&DateTo=01/01/2013&Type=sports
    I've google for help and not sure they seem working so far.

    Hi,
    If you want to filter a Content Query Web Part with the parameters from URL, we can achieve it with OOTB of Content Query Web Part by adding "Additional Filters" in "Web Part Properties"->"Query". We can add
    three filters like:
    date is greater than [PageQueryString:DateFrom]
    And
    date is less than [PageQueryString:DateTo]
    And
    type is equal to [PageQueryString:Type]
    Then redirect to the URL: www.mywebsite.com/pages/Filter.aspx?DateFrom=01/01/2012&DateTo=01/01/2013&Type=sports, the query results will be filtered.
    Please reply freely if I misunderstand your meaning or there any other questions.
    best regards
    Patrick Liang
    TechNet Community Support

  • Mapping display only item to three output parameters from a procedure?

    Hi all
    I have a procedure with three output parameters, which I would like to map the three output parameters to three display only items on the page.
    there is a page process called the procedure, which output statement1,statement2,statement3 parameters.
    I have three items on the page which I would like to map them to the three parameters respectively,
    how can I achieve this?
    thanks

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • SECATT, use output parameters from a recorded transaction

    Hi everybody,
    I'm testing the functionality of the SECATT transaction. I have a question about the folllowing case:
    someone has recorded mutliple transactions and wants them to be executed one after the other. But, 1 of these recorded transactions needs data that is generated by a previous transaction. Is this in some way possible (do these transactions generate some output parameters and can you capture them in your local parameters).
    thank you in advance,
    Tom

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • Getting Empty Values in Out Parameters of PLSQL procedure after invoking DB

    Hi,
    I have written one simple procedure which takes item_no and returns its unit price and error message.
    After invoking the Data Base Adaptor with the the procedure call, I can see the out parameter values in XML file, but if try to assign the value to the Global Variable it assigns a null value.
    Why its giving Null value for Outparameters of Procedure call, and even I can see the values in XML file of DabaseAdaptor call.
    Please provide a solution to restore values of Outparameters.
    Even values are not populated using File Adaptor through Transformation.
    Thanks !!!
    Rajesh.
    Edited by: user11977156 on May 10, 2010 4:33 PM
    Edited by: user11977156 on May 11, 2010 12:12 AM

    Required Code:
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Tue May 11 14:55:55 IST 2010
    Author: rsavant
    Purpose: Asynchronous BPEL Process
    -->
    <process name="Xx1GetItemPrice"
    targetNamespace="http://xmlns.oracle.com/Xx1GetItemPrice"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/Xx1GetItemPrice"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/svcGetItemPrice/"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXSAVANT_GET_ITEM_PRICE/"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:Xx1GetItemPrice"
    myRole="Xx1GetItemPriceProvider"
    partnerRole="Xx1GetItemPriceRequester"/>
    <partnerLink name="svcGetItemPrice" partnerRole="svcGetItemPrice_role"
    partnerLinkType="ns1:svcGetItemPrice_plt"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable"
    messageType="client:Xx1GetItemPriceRequestMessage"/>
    <!-- Reference to the message that will be sent back to the requester during callback -->
    <variable name="outputVariable"
    messageType="client:Xx1GetItemPriceResponseMessage"/>
    <variable name="p_item_no" messageType="ns1:args_in_msg"/>
    <variable name="outParameters" messageType="ns1:args_out_msg"/>
    <variable name="tempOutParameters"
    element="client:Xx1GetItemPriceProcessResponse"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in Xx1GetItemPrice.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:Xx1GetItemPrice" operation="initiate"
    variable="inputVariable" createInstance="yes"/>
    <!--
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    <assign name="Input">
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:Xx1GetItemPriceProcessRequest/client:input"/>
    <to variable="p_item_no" part="InputParameters"
    query="/ns2:InputParameters/ns2:P_ITEM_NO"/>
    </copy>
    </assign>
    <invoke name="invkCallGetItemPrice" partnerLink="svcGetItemPrice"
    portType="ns1:svcGetItemPrice_ptt" operation="svcGetItemPrice"
    inputVariable="p_item_no" outputVariable="outParameters"/>
    <assign name="Output">
    <copy>
    <from expression="string(bpws:getVariableData('outParameters','OutputParameters','/ns2:OutputParameters/ns2:P_UNIT_PRICE'))"/>
    <to variable="outputVariable" part="payload"
    query="/client:Xx1GetItemPriceProcessResponse/client:result"/>
    </copy>
    </assign>
    <invoke name="callbackClient" partnerLink="client"
    portType="client:Xx1GetItemPriceCallback" operation="onResult"
    inputVariable="outputVariable"/>
    </sequence>
    </process>

  • Get out values from stored procedure

    Hi folks,
    I have need of an aid. I have created this stored procedure:
    CREATE OR REPLACE PROCEDURE ProceduraDiProva (
    p_val1 IN NUMBER DEFAULT 1,
    p_val2 IN NUMBER DEFAULT 1,
    p_val3 OUT NUMBER,
    p_val4 OUT NUMBER)
    AS
    BEGIN
    p_val3 := p_val1 + p_val2;
    p_val4 := 999;
    END ProceduraDiProva;
    I call the procedure into shell script
    $ORACLE_HOME/bin/sqlplus -s user/pwd@oracleid > oracle.log << END
    spool ciccio.txt
    declare
    var a_out number;
    var b_out number;
    begin
    var a_out:=0;
    exec ProceduraDiProva(1, 2, a_out, b_out);
    end;
    spool off;
    exit
    END
    I would know as I make to insert 'a_out' and 'b_out' in a shell variables
    Tanks in advance

    I found an example with windows
    Create a file cmd with;
    FOR /F "usebackq delims=!" %%i IN (`sqlplus -s %usuario%/%pwd%@%ddbb% @1.sql`) DO set xresult=%%i
    echo %xresult%
    And the 1.sql:
    set timing off
    set feedback off
    set pages 0
    select sysdate from dual;
    exit
    ------------------------------------------------------------------------------------------

  • Simple question about using passing parameters in a procedure

    I have a below stored procedure (part of a package) that I need to modify by removing hard coded declaration of "cutoffdays" and change it into a parameter passed from procedure. I am not sure how to do declare and pass values for delete from a table.
    CREATE OR REPLACE PROCEDURE  counttimes
    IS
       CutOffDays   NUMBER := 14;
    BEGIN  
    DELETE FROM   timetable
             WHERE   timestamp_val < SYSDATE - CutOffDays;
       COMMIT;
    END counttimes;

    Hints
    <li>never commit at the end of a procedure, if you didn't commit at the beginning. Do the transaction handling at a higher level.</li>
    <li>Name the procedure so that it is clear what it does. If records are deleted, then the procedure name should reflect that.</li>
    <li>Work with full days, i.e. use trunc(sysdate) instead of sysdate. </li>
    CREATE OR REPLACE PROCEDURE  removeTimes (CutOffDays in integer)
    IS
    BEGIN  
           DELETE FROM   timetable
           WHERE   timestamp_val < trunc(SYSDATE) - CutOffDays;
    END counttimes;Edited by: Sven W. on Feb 14, 2011 4:17 PM

  • How to use DATETIME parameters in stored procedure?

    I can not define a variable or parameters
    with data type of DATETIME
    when I define stored procedure using Developer/2000.
    Does Oracle not support DATETIME?
    null

    Chen Honghua (guest) wrote:
    : I can not define a variable or parameters
    : with data type of DATETIME
    : when I define stored procedure using Developer/2000.
    : Does Oracle not support DATETIME?
    Oracle supports DATETIME data type.
    "DATETIME" data type is stored in "DATE" data type.
    if you want to DEFINE "10-Jan-1998 10:20" :
    declare
    dummy_date date:=to_date('10-jan-1998 10:00','DD-MON-YYYY
    HH24:MI');
    BEGIN
    END;
    null

Maybe you are looking for

  • Yast installation problem on Oracle Enterprise Linux Rel 5 Upd 2

    Hi, I installed Oracle Enterprise Linux Rel 5 Upd 2 on a new server (Intel 64 bit) with the downloads from oracle (Enterprise-R5-U2-Server-x86_64-disc1.iso till Enterprise-R5-U2-Server-x86_64-disc6.iso). Then I wanted to install Yast for administerin

  • Time/Date Stamp your video file

    Hi there, I have a number of video files and I need to burn in time (h:m:s) and date onto them without metadata using offsets. Is this at all possible with premiere? Some files are 30 hrs long - monitoring outside conditions and I need the date to sw

  • Replacing some grey tones with color?

    Hello, For this school project I need to make a design for a big wall in an accountancy/economy theme. My idea is to desaturate a bunch of pictures related to the theme, and make the middle or lower grey tones green. I couldn't find a tutorial on the

  • Deciding RFC destination dynamically

    Hello All,          I need to call a RFC which is there in R3 system from SRM system . While calling RFC I want to decide the RFC destination name dynamically i.e. depending upon the development , quality and production environment.          Is there

  • Clients connect to wifi with certificate that expires every month - correct way to handle expired certificates?

    Hi all I'm sorry if this is the wrong forum to ask this question. Also my knowledge in this area is somewhat limited, which I why I need your help :-) We use wireless networks primarily in my company for all our clients and use a certificate to authe