Regd Out procedure parameters

Hello

I'm trying to run a simultaneous program to the OA Page and I wrote the code for the same below.

OADBTransactionImpl t1 = (OADBTransactionImpl) getDBTransaction ();
System.out.println ("submit button 11 testing");
int preqid;
int out_value;
int test = 0;
String perrbuf;
String s1 = "start xxchr_test_submit_program (preqid = >: 1); END; " ;
System.out.println ("submit button 22 testing");
Proc1 OracleCallableStatement = (OracleCallableStatement) t1.createCallableStatement (s1,-1);
Proc1.registerOutParameter(1,OracleTypes.int);
ST1.registerOutParameter(5,OracleTypes.varchar);
out_value = Proc1.GetInt (1);
System.out.println ("testing submit button 33");
Proc1.Execute ();
System.out.println ("submit button 44 testing");
T1.commit ();
System.out.println ("preqid");
System.out.println ("perrbuf");


There is a parameter to my out procedure: xxchr_test_submit_program (preqid = >: 1); as

CREATE or REPLACE procedure APPS.xxchr_test_submit_program (p_request_id_o out varchar2)
-return the number of
as
-number of p_request_id_o;
p_errbuf_o varchar2 (200);
BEGIN
-Fnd_Global.apps_initialize (userId, responsibilityId, applicationId)
Fnd_Global.apps_initialize (28501,50612,800);
p_request_id_o: =.
() fnd_request.submit_request
request = > "XXCHR"
program = > "XXCHR_EDSG_DATA_MAPPING_LOAD"
Description = > NULL,
-start_time = > TO_CHAR (SYSDATE, "MON-DD-YY HH24:MI:SS"),
sub_request = > FALSE);
p_errbuf_o: = substr (fnd_message.get, 1, 240);
-dbms_output.put_line (1 ' | v_request_id);
-dbms_output.put_line (2 ' | x_errbuf);
-return p_request_id_o;
end;


I'm not able to handle this output parameter. .pls help

Proc1.registerOutParameter(1,OracleTypes.int); is also errorin on... Help, please...

Kind regards
Preeti

Import oracle.jdbc.driver.OracleTypes;

Tags: Oracle Applications

Similar Questions

  • It is possble the out/inout parameters in function?

    It is possble the out/inout parameters in function?

    student001 wrote:

    Could you please explain why...

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e10592/functions254.htm#SQLRF06181

    For example, user-defined functions can be used in the following:

    -The select list of a SELECT statement
    -The condition of a WHERE clause
    -CONNECT BY START WITH ORDER BY and GROUP BY clauses
    -The VALUES of an INSERT clause
    -The SET of an UPDATE statement clause

    Because you will not be able to do these things.

  • Cannot access stored procedure parameters

    Hello

    We are at the point where you try to use a stored procedure from our Java through Toplink code but we seem to have a problem here I couldn't find an answer to. Maybe it's that my Google-Fu is miss you in this case.

    Our problem is thto so that the procedure seems to be cited correctly, we get nothing to Java code. The procedure in question has been tested with the same input parameters of SQLDeveloper and the procedure returns values as it should.

    The procedure signature is

    create or replace PACKAGE FORM_METADATA AS

    PROCEDURE FORM_LIST_GET)

    P_USER_ID IN VARCHAR2,

    P_CHANNEL_NO NUMBER,

    P_START_FROM in NUMBERS, paging

    P_COUNT_TO_RETURN in NUMBERS, paging

    P_GET_TOTAL_COUNT in NUMBER, - if number must total be returned then 1, other wise 0

    P_RESULT_SET ON SYS_REFCURSOR,

    P_TOTAL_COUNT CERTAIN NUMBER);

    end FORM_METADATA;


    Java code invoking this procedure looks like this:

    County of BigDecimal = new BigDecimal(-1);

    A session = getSession().

    session.setLog (new OutputStreamWriter (System.out));

    session.setLogLevel (SessionLog.FINEST);

    StoredProcedureCall procedureCall = new StoredProcedureCall();

    procedureCall.setProcedureName "(FORM_METADATA. FORM_LIST_GET");

    procedureCall.addNamedArgumentValue ("P_USER_ID", "name of user-1");

    procedureCall.addNamedArgumentValue ("P_CHANNEL_NO", new BigDecimal (1));

    procedureCall.addNamedArgumentValue ("P_START_FROM", new BigDecimal (1));

    procedureCall.addNamedArgumentValue ("P_COUNT_TO_RETURN", new BigDecimal (1000));

    procedureCall.addNamedArgumentValue ("P_GET_TOTAL_COUNT", new BigDecimal (1));

    procedureCall.useNamedCursorOutputAsResultSet ("P_RESULT_SET");

    procedureCall.addNamedOutputArgument ("P_TOTAL_COUNT", "count", BigDecimal.class);

    DataReadQuery dq = new DataReadQuery();

    dq.setCall (procedureCall);

    dq.prepareForExecution ();

    Object result = session.executeQuery (dq);

    System.out.println ("result:" + result);

    System.out.println ("result from StoredProcedreCall:" + procedureCall.getResult ());

    The output we get looks like this:

    [Warning TopLink]: 2015.08.31 16:11:30.781 - failed to get InitialContext for saving of MBean: javax.naming.NoInitialContextException: need to specify the class name in the environment or property of the system, as a cmdlet parameter or in a file of application resources: java.naming.factory.initial

    [Warning TopLink]: 2015.08.31 16:11:30.797 - failed to get InitialContext for saving of MBean: javax.naming.NoInitialContextException: need to specify the class name in the environment or property of the system, as a cmdlet parameter or in a file of application resources: java.naming.factory.initial

    [TopLink info]: 2015.08.31 16:11:31.685 - DatabaseSessionImpl (1827000661) - TopLink, version: Oracle TopLink - 11 g Release 1 (11.1.1.5.0) (Build 110305)

    [TopLink info]: 2015.08.31 16:11:34.147 - DatabaseSessionImpl (1827000661) - dev connection successful

    [TopLink Finest]: 2015.08.31 16:11:34.147 - DatabaseSessionImpl (1827000661) - wire (wire [main, 5, main])-Execute query DataReadQuery()

    [TopLink Finest]: 2015.08.31 16:11:34.163 - DatabaseSessionImpl (1827000661) - wire (wire [main, 5, main])-re-connect to the external connection pool

    [TopLink fine]: 2015.08.31 16:11:34.227 - DatabaseSessionImpl (1827000661) - connection (1635575430) - wire (wire [main, 5, main])-START FORM_METADATA. FORM_LIST_GET (P_USER_ID = >?, P_CHANNEL_NO = >?, P_START_FROM = >?, P_COUNT_TO_RETURN = >?, P_GET_TOTAL_COUNT = >?, P_RESULT_SET = >?, P_TOTAL_COUNT = >?); END;

    link = > [name of user-1, 1, 1, 1000, 1, = > P_RESULT_SET = > P_TOTAL_COUNT]

    [Result:]

    Result of the StoredProcedreCall: null

    Process has finished with exit code 0.


    I'm pretty sure that our problem is with Java code invoking the procedure, but as I said, we were not able to find the right solution yet. Anyone have a pointer as to where we should begin to look for next?

    Thank you in advance,

    Mika Leino

    One of my colleagues managed to find the reason why the procedure does not seem to return anything. For brevity, I've redacted a couple of settings that we were not used to this forum and we do not believe the reason for the perceived behavior. However, as well as the required parameters these have the value NULL. My colleague seems to try initialize parameters without value and after that the query returned a set of data that was expected.

    Our change of code (in Java) was therefore to spend

    procedureCall.addNamedArgumentValue("P_ORDER_BY", OracleTypes.NULL);
    

    TO

    procedureCall.addNamedArgument("P_ORDER_BY");
    

    Now we're getting data from the cursor, as expected, but the second parameter value still eludes us.

  • Get the EXIT and the RETURN of a stored procedure parameters

    I have a stored procedure (SQL Server 2008 R2 MS) as in the following example.

    Thanks to the connectivity of database I get OUTPUT parameters, but I can't get the game DATA RECORDS and RETURN value.

    Someone knows how to do this?

    CREATE PROCEDURE [dbo]. [TS_Teste] (@T057_S_NOMEMAQUINA VARCHAR (20), @STATUS INT OUTPUT, OUTPUT OF NVARCHAR (500) OF @ERRO)

    AS

    BEGIN
    DECLARE THE TABLE @TABLE (CODE INT, DESCRIPTION VARCHAR (30))

    INSERT VALUES INTO @TABLE (51, 'A')
    INSERT VALUES INTO @TABLE (52, 'B')

    INSERT VALUES INTO @TABLE (53, 'C')

    SELECT * FROM @TABLE

    SET @STATUS = 1

    SET @ERRO = "Nenhum erro!

    RETURN 0

    END

    I finally found what was wrong... He had a line in the stored procedure only aditional. It should be like this:

    CREATE PROCEDURE [dbo]. [TS_Teste] (@T057_S_NOMEMAQUINA VARCHAR (20), @STATUS INT OUTPUT, OUTPUT OF NVARCHAR (500) OF @ERRO)

    AS

    BEGIN
    SET NOCOUNT ON;                                                                                               -NEW LINE!

    DECLARE THE TABLE @TABLE (CODE INT, DESCRIPTION VARCHAR (30))

    INSERT VALUES INTO @TABLE (51, 'A')
    INSERT VALUES INTO @TABLE (52, 'B')

    INSERT VALUES INTO @TABLE (53, 'C')

    SELECT * FROM @TABLE

    SET @STATUS = 1

    SET @ERRO = "Nenhum erro!

    RETURN 0

    END

  • How to use the nocopy with java stored procedures parameters

    
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    

    I'm a PL/SQL programmer, but not a Java programmer. I have the following java function that does what it's supposed to add a pdf at the end of another pdf document:

    import oracle.sql.BLOB;
    import org.apache.pdfbox.util.PDFMergerUtility;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    import java.io.OutputStream;
    
    public class PDFUtilities {
    public static BLOB appendPDF(BLOB pdfdoc1, BLOB pdfdoc2) throws Exception {
           
            //create a connection object to the current instance
              OracleConnection conn = (OracleConnection)new OracleDriver().defaultConnection();
            //create the output blob using the connection
              BLOB outPDF = BLOB.createTemporary(conn, true ,BLOB.DURATION_SESSION);
            //create an output stream to the output blob
              OutputStream os = outPDF.setBinaryStream(0);               
            //instantiate the pdf merger utility
              PDFMergerUtility mergerUtility = new PDFMergerUtility();       
            //connect the merger to the output stream
              mergerUtility.setDestinationStream(os);
            //stream from each input blob into the merger utility
              mergerUtility.addSource(pdfdoc1.getBinaryStream());
              mergerUtility.addSource(pdfdoc2.getBinaryStream());
            //merge the 2 input pdfs
              mergerUtility.mergeDocuments();             
            //do not close the output stream
            //return the blob
            return outPDF;
        }
    
    }
    

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob;
    end pkg_pdf_utilities;
    /
    
    CREATE OR REPLACE package body PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob
      as language java name 
      'com.mycode.pdftools.PDFUtilities.appendPDF(oracle.sql.BLOB, oracle.sql.BLOB) return oracle.sql.BLOB';
    end PDFTOOLS.pkg_pdf_utilities;
    /
    

    It's very basic, but doesn't seem to work. However, I want to my function from PL/SQL to a procedure that looks like this:

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    procedure sp_append_pdf (
              pio_pdf2append2   IN OUT NOCOPY blob
            , pio_pdf2append   IN OUT NOCOPY blob
      )
    end pkg_pdf_utilities;
    /
    

    What is important, what I'm trying to do is to NOCOPY the BLOBs. Otherwise, I have to read my PDF files into 2 BLOBs and create a 3rd blob as output. I prefer to be able to keep the pio_pdf2append2 as the final output. What I actually do call thing in a loop to gradually add a PDF file to a big. I'm not linking this in one operation because of concerns over the use of the system and because the pdfbox library java has would have been question after 850 in PDF format, which is not completely unrealistic in my approach.

    How could I achieve this?

    Post edited by: Pollocks01 only formatted code blocks because atlassian {code} tags didn't work.

    Passage of an argument as input/OUTPUT requires the mapping to a Java array.

    Simplified example that adds one FOR the other:

    create or replace and compile java source named blob_appender_src as
    import oracle.sql.BLOB;
    import java.sql.SQLException;
    import java.io.OutputStream;
    import java.io.InputStream;
    import java.io.IOException;
    
    public class BLOBAppender {
        public static void run (BLOB[] p1, BLOB p2) throws SQLException, IOException { 
    
            InputStream is = p2.getBinaryStream();
            OutputStream os = p1[0].setBinaryStream(p1[0].length()+1);                
    
            byte[] buffer = new byte[1024];
            int len;
            while ((len = is.read(buffer)) != -1) {
                os.write(buffer, 0, len);
            }
            os.close();
            is.close();
        }
    }
    
    create or replace procedure blob_append (
      p_lob1  in out nocopy blob
    , p_lob2  in            blob
    )
    as language java name 'BLOBAppender.run(oracle.sql.BLOB[], oracle.sql.BLOB)' ;
    /
    
    SQL> declare
      2    p_lob1  blob := utl_raw.cast_to_raw('ABC');
      3    p_lob2  blob := utl_raw.cast_to_raw('DEF');
      4  begin
      5    blob_append(p_lob1, p_lob2);
      6    dbms_output.put_line(utl_raw.cast_to_varchar2(p_lob1));
      7  end;
      8  /
    
    ABCDEF
    
    PL/SQL procedure successfully completed.
    
  • sys_refcursor outside procedure parameters

    Hello
    I created a procedure who receive the SQL to VARCHAR' datatype settings and return the result in a refcursor set:
    create or replace
    procedure my_test(VAL1 in number, val2 in number, val3 in number, val4 in VARCHAR2, vla5 out nocopy SYS_REFCURSOR )
    is
    begin
      open vla5 for 'select * FROM (select x_x.*  ,rownum rn  FROM ('||val4 ||') x_x where rownum <= '|| to_char(val3)||' ) where rn >='|| to_char(val2);
    end;
    I like to spend and receive val4 and val5 in a settings:
    procedure my_test(VAL1 in number, val2 in number, val3 in number, val4 in out nocopy SYS_REFCURSOR )
    I would like to pass the SQL statement to the VARCHAR2 data type to my procedure and return the result in the same variable settings.
    I don't know if my English was understanding, but could you please help me find a solution?

    Thank you very much.

    Salvatore of Cala

    Can we have more details please?

    A sys_refcursor isn't a SQL statement you can add predicates. So it is not possible to combine the two arguments. Not at all.

    To receive a refcursor and try to do is not make sense.
    See Refcursor 101 thread:
    PL/SQL 101: Understand the Ref Cursor

    If you receive a SQL as a CLOB to VARCHAR2/LONG you want and wrap with more predicates then you can do that just with string manipulation - you do.

    However, if you receive a SQL string and want to wrap up with one statement select and other predicates, you use binds to the underlying values not string concatenation of literals which is likely to be bad performance and a possible security problem (see also DBMS_ASSERT).

    Published by: DomBrooks on November 9, 2010 11:00

  • Global variables packed... rather than packaged procedure parameters...

    Hello
    There is only one version of procedures packed with parameters that are called in the following diagram.
    Package test
      function A(p1)
        as
         begin
           return x;
         end;
        
      procedure test1(x1 ..... ,
                             x2 tab%rowtype)
         as
           local_1 .....;

           begin
               ....
              local_:=A(p=>....);  /*the function is called*/
              test2(x3=>x1,    
                       x2=>x4);      /*the below procedure is called*/ 
           end;

      procedure test2(x3 .....,
                              x4 tab%rowtype)
       as
         begin
             .....                 /*before the commit another procedure
                                     is called (which is also declared in this package
                                     but is not written here....)*/
             insert into .....
             commit;
         end;
    Instead of passing parameters of the procedure for the procedure to be used in the last procedure, namely in test2, I consider to change the schema above and declare a packaged global variable which are available to all procedures in the package...
    Something like...
    package test
    as
        x1 ......;
       x2  tab%rowtype;
       <other variables>
      function A;
      procedure test1;
      procedure test2;
      ......
    Is there another way...?

    Note: I use DB 10.2.0.4
    Thank you
    SIM

    the only danger is almost simultaneously in the same session
    two executions of the packaged procedures/functions are running

    But that can never happen.

    A session is single-threaded (I don't know if it's the correct term).

    You cannot run two... things... at the same time.

  • Procedure parameters

    What is the maximum range of the parameter which accept a procedure?

    Hello

    Reference guide, PL/SQL and PL/SQL from the user program limits

    in 9i

    http://download-West.Oracle.com/docs/CD/B10501_01/AppDev.920/a96624/e_limits.htm#LNPLS018

    The answer is 64 KB.

    and in 10 g

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/limits.htm

    The answer is 65536.

    concerning
    Hitesh

    Published by: Hitesh Nirkhey January 20, 2011 11:12

  • How to change the names of the OUT parameters

    Hi all

    I have a requirment as I'm a "sample_procedure" with two parameters and two stored procedure PARAMETERS.

    sample_procedure (p_new IN varchar2,
    p_old IN varchar2,
    p_start_list OUT t_start, - table type
    p_end_list to t_end); -table type



    now, I want to change the names of two of the parameters OUT without disturbing the one (sample_procedure) original. so for this, I need to create new stored again procedure.then SP, I call "sample_procedure". returned variables should change as mentioned name new bellow.the Sp mancunts also have the same parameters of entry... like


    sample_procedure (p_new IN varchar2,
    p_old IN varchar2,
    LIST_ONE OUT t_start, - table type
    LIST_TWO to t_end); -table type





    the p_start_list should be replaced by LIST_ONE


    the p_end_list should be replaced by LIST_TWO


    the new SP should behave same as 'sample_procedure', but with THE different parameter names (LIST_ONE, LIST_TWO).


    can someone guide me please with an example... Thanks in advance.

    It looks like you want

    create or replace procedure sample_procedure (p_new      in     varchar2,
                                                  p_old      in     varchar2,
                                                  list_one      out t_start,  -- table type
                                                  list_two      out t_end)   -- table type
    as
    begin
       sample_procedure (p_new       => p_new,
                         p_old       => p_old,
                         p_start_list => list_one,         -- table type
                         p_end_list  => list_two);        -- table type
    end sample_procedure;
    

    Although I think that maybe you're in trouble because you will not be able to call the procedures more due to the same overload (same name, same types of arguments)...

  • How to call parameters for a procedure of a table?

    Hello world

    I use the oracle 11.1.0.6 version.


    I have a procedure that must call 6 parameters in a table. Could I know how to perform the procedure parameters in a table?

    Now, I'm running a .sql file.

    SELECT TO_CHAR(SYSDATE,'DD/MM/YY hh24:mi:ss') FROM DUAL;
    EXEC call_all (201208, 'DBC', 2, 'Choice', 201223, 201236);

    Thanks in advance

    How do you get the values of the parameters to pass to the CALL_ALL procedure?

    If you want to get all the parameters to pass to CALL_ALL, to be taken from the table, you will need to do so in an anonymous PL/SQL block/function/stored procedure as below:

    declare
     v_bmonth       param.bmonth%type;
     .
     .
     .
     v_tweek_2     param.tweek_2%type;
    begin
     select bmonth, ssc, label, tweek_1, tweek_2
        into v_bmonth, ..., v_tweek_2              ---> ... corresponds to Individual Parameter variable
       from param p
     where p.some_column = some_value        ---> This condition should be able to fetch only One row from table, else it will throw error.
    
     call_all(v_bmonth, ... v_tweek_2);
    end;
    
    ------Alternative-------------------
    declare
     v_param            param%rowtype;
    begin
     select *
        into v_param
       from param p
     where p.some_column = some_value        ---> This condition should be able to fetch only One row from table, else it will throw error.
    
     call_all(v_param.bmonth, ... v_param.v_tweek_2);     ---> ... corresponds to v_param."Column_Name" for corresponding column names.
    end;
    

    Just read that you want to run the procedure for all values:

    begin
      for cur in (select * from param) loop
    
        call_all(cur.bmonth, ... cur.v_tweek_2);
    
      end loop;
    end;
    

    I want to do it in a simpler way:

    create or replace function f_execute_call_all
    (
    b_bmonth in number,
    b_banner_name in varchar2,
    b_ssc in number,
    b_label in varchar2,
    b_tweek_1 in number,
    b_tweek_2 in number
    )
    return number is
    begin
      call_all(bmonth,banner_name,ssc,label,tweek_1,tweek_2);
    
      return 1;
    exception
      when others then
         -- Log Exception Message
         raise;
    end;
    
    calling Code:
    
    select f_execute_call_all(bmonth,banner_name,ssc,label,tweek_1,tweek_2) from param;
    
  • Process 1 gr 2 OWB flow - how to pass parameters to a procedure

    Hello
    In 10.1 OWB processflow IN procedure parameters can be passed in the activity view that appears on the choice of the procedure within the processflow. How to enter the parameters IN the case of OWB11gr2. In property inspector no options are there. Any help is much appreciated

    Hello

    Select the processing activity. In the structure window, select the parameter. Then, you can set the binding or the value in the Properties window.

    Sometimes the property window is not updated when the setting is selected. Double-click the bar from the window of the property window to maximize.

    Kind regards
    Carsten.

  • How to perform the procedure in the SQL worksheet?

    Hi, anyone knows, how I can execute procedure here?

    I try to EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there's a SQL statement error. When I use the CALL - there is no such procedure (I have execute privileges).

    Although in SQLPlus EXEC works, but there are problems with the standard SQL commands (each of them '2' returns any content is).

    Any ideas?

    Concerning
    Krzysztof

    EXEC procedure (parameters) is a plu sql (and some others) shortcut for

    BEGIN
       procedure(parameters);
    END;
    

    So try that and then pressing / on anything in the sql worksheet that makes a statement in execution.

    Note that if your procedure has defined parameters as OUT or IN OUT, you need to provide a variable to accept the returned values.

    John

  • NEED HELP WITH THE PROCEDURE

    Hi, earlier I had a doubt using the function or procedure function or procedure? Thanks to all who helped. but I found a way to use task2e with procedure. I would like to insert the issue.

    Cumulative 2nd task spends point procedure
    You create a stored procedure called spRollupExpenseItem. This procedure updates
    the corresponding line in the BudgetItem table given a report of expenses and the expense category number
    number. The procedure contains three input parameters, the value of ERNo, the value of ECNO.
    and the amount of cumulative, as well as a single parameter of Boolean result.
    This is the logic of the procedure.
    · If the corresponding ExpenseReport line (ERStatus) status is DENIED or
    MEANWHILE, an application error is triggered. The output parameter is set to False.
    · Otherwise, the corresponding BudgetItem line is updated. The actual amount (BIActual) in the
    line corresponding BudgetItem are incremented by the input of the cumulative amount parameter.
    o the output parameter is set to True after running the update
    operation.


    good task2e can be used using procedure by housing 'OUT' in parameters.here is the code

    CREATE OR REPLACE PROCEDURE spRollupExpenseIetm
    (P_ERNO IN FULL, P_ECNO ENTIRE, WHOLE ROLLUP_AMOUNT, BOOLEAN P_OUTPUT) IS

    ERSTATUS_ERROR EXCEPTION;
    V_ERSTATUS EXPENSEREPORT. TYPE % ERSTATUS;
    BEGIN
    SELECT ERSTATUS FROM V_ERSTATUS
    OF EXPENSEREPORT
    WHERE ERNO = P_ERNO;

    IF (V_ERSTATUS = 'PENDING' OR 'DENIED' = V_ERSTATUS) THEN
    P_OUTPUT: = FALSE;
    RAISE ERSTATUS_ERROR;
    ON THE OTHER
    UPDATE BUDGETITEM
    SET BIACTUAL = BIACTUAL + ROLLUP_AMOUNT
    WHERE ECNO = P_ECNO;
    P_OUTPUT: = TRUE;
    END IF;
    EXCEPTION
    WHEN ERSTATUS_ERROR THEN
    RAISE_APPLICATION_ERROR (-20564, ' ERROR: ERSTATUS is either pending or DENIED ');
    END spRollupExpenseIetm;




    his compiled without errors. My next question is

    2f task create Rollup fees trigger
    You create a trigger called TR_RollupExpAmt. This trigger fires after the power to the
    approved expenses amount (ExpApprAmt) or the deletion of a row in the table ExpenseItem. The
    following points explain the logic of this trigger:
    · If updating the ExpApprAmt column, the cumulative amount should be the difference
    of the New.ExpApprAmt under the Old.ExpApprAmt.
    · If the deletion of a row of the table of ExpenseItem, the cumulative amount should be the
    the Old.ExpApprAmt negative.
    · To run the update rollup, you must call the spRollupExpenseItem procedure
    described in the 2nd special.
    · If the output of the spRollupExpenseItem procedure parameter is true, insert a line
    in the table (Log_Table) exception log.
    o the ExcText (message explaining the error) value should indicate the
    operation (update or delete) and the cumulative amount.
    o If the output of the spRollupExpenseItem procedure parameter is false,
    do nothing.


    to do this I found on the internet http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030 where he explained in the example he adds the output in the "my_first_proc" procedure parameter
    p_an_out_parameter DATE

    Then, he calls this procedure like this
    () my_first_proc
    p_name = > v_employee,
    p_an_in_out_parameter = > v_number,
    p_an_out_parameter = > T_DATE);

    IAM so intend to do the same by task2f task2e call and check the P_OUTPUT value. If iam wrong please let me know.

    and iam confused with task2f is
    If updating the ExpApprAmt column, the cumulative amount should be the difference
    of the New.ExpApprAmt under the Old.ExpApprAmt.
    · If the deletion of a row of the table of ExpenseItem, the cumulative amount should be the
    the Old.ExpApprAmt negative.

    How do I know if it is updated or deleted?
    I hace an idea but don't know if its valid or does not check EXPAMT to null as
    if(:New.) EXPAMT = NULL)
    ........
    can I do that. I know confectioners question sorry to make u read the whole story.

    Hello

    Whenever you write code, you should lower lines to see the where to begin blocks BEGIN and end, what are multiline statements and things like that.
    Whenever you post the text on this site, type these 7 characters:

    {code}

    (small letters only, inside curly braces) before and after sections of formatted text.
    After exactly what is causing the error message. The line of the error message numbers are too high; have you not after a few empty lines?

    Section causing errors seems to be:

    ...
        IF (UPDATING) THEN
            UPDATE EXPENSEITEM
                SET EXPAPPRAMT = :NEW.EXPAPPRAMT - :OLD.EXPAPPRAMT    -- No semicolon here
                WHERE ECNO = :NEW.ECNO;
            spRollupExpenseIetm(V_ERNO, V_ECO, ROLLUP_AMOUNT, P_POUTPUT);
            IF(V_OUTPUT = TRUE) THEN
                insert into log_table
                    (excno, exctrigger, exctable, exckeyvalue, excdate, exctext)
                    values
                    (LOG_SEQ.NEXTVAL,
                    'TR_ROLLUPEXPAMT',
                    'EXPENSEITEM',
                    V_ECNO,
                    v_timestamp,
                    'ERROR WHILE UPDATING, ROLLUP AMOUNT = ' || ROLLUP_AMOUNT    -- Is this what you want?
                    );
            END IF;
        END IF;
    

    You had a semicolon in the middle of the UPDATE statement.
    I see no 14 lines obvoius error later. The first error risk fi END does not correctly interpret.

    I also changed the end of the INSERT statement.

    Don't forget to put a colon in the record names: NEWS and: OLD.

    Published by: Frank Kulash, 28 January 2010 06:42

  • Creating classic report to the stored procedure.

    How can we create a report based on a stored procedure out parameter.

    Can someone please help.

    Thank you

    Nani.

    Nani4850 wrote:

    Out parameter is a multi-level object type.

    I found a way to sort of basis a report on the parameter OUT procedure. The approach is:

    1. call the procedure in a process before PL/SQL areas, convert the object returned in an XML document and store in a collection XMLType column:

    declare
    
      k_rate_query varchar2(255) := 'RATE_QUERY';
    
      l_rate_type_code  number;
      l_rate_query      rate_rec;
      l_xml             xmltype;
    
      l_seq_id number;
    
    begin
    
      l_rate_type_code := to_number(:p1_rate_type_code);
      api_pkg.rate_query(l_rate_type_code, l_rate_query);
      l_xml := xmltype.createXML(l_rate_query);
    
      if not apex_collection.collection_exists(k_rate_query)
      then
        apex_collection.create_collection(k_rate_query);
      end if;
    
      select
          seq_id
      into
          l_seq_id
      from
          apex_collections
      where
          collection_name = k_rate_query
      and n001 = l_rate_type_code;
    
      apex_collection.update_member_attribute(k_rate_query, l_seq_id, 1, l_xml);
    
    exception
    
      when no_data_found
      then
        apex_collection.add_member(
            p_collection_name => k_rate_query
          , p_n001 => l_rate_type_code
          , p_xmltype001 => l_xml);
    
    end;
    

    2. use a SQL/XML query on the XML collection in the region report source:

    select
        rq.*
    from
        apex_collections ac
      , xmltable(
            '/RATE_REC/RATE_TBL/RATE_REC_TYPE'
            passing ac.xmltype001
            columns
                action_code         varchar2(20)  path 'ACTION_CODE'
              , rate_key            number        path 'RATE_KEY'
              , rate_type_code      varchar2(5)   path 'RATE_TYPE_CODE'
              , program_key         varchar2(12)  path 'PROGRAM_KEY'
              , rate                number(8,5)   path 'RATE'
              , effective_date      date          path 'EFFECTIVE_DATE'
              , current_yn          varchar2(1)   path 'CURRENT_YN'
              , non_current_dt      date          path 'NON_CURRENT_DT'
              , non_current_by_id   varchar2(4)   path 'NON_CURRENT_BY_ID'
              , non_current_reason  varchar2(400) path 'NON_CURRENT_REASON') rq
    where
        ac.collection_name = 'RATE_QUERY'
    and ac.n001 = to_number(:p1_rate_type_code)
    
  • can we create a procedure in a procedure

    DB version: 11 g

    Hello

    I just wanted to ask guys like can create us a procedure in a procedure... If not is there another solution?

    in db2, it is therefore permissible cela oracle support?

    Thank you

    Can you? Sure. Should you? Usually not.

    You can do something like

    CREATE OR REPLACE PROCEDURE p1
    AS
      <>
    
      PROCEDURE p2
      IS
      BEGIN
        <>
      END p2;
    BEGIN
      p2;
    END;
    

    It is rarely indicated, however, to declare nested blocks that way. As always, you should be setting out procedures in packages in any case, it would be much more sensible to define a private procedure in the package body you are calling.

    Justin

Maybe you are looking for