How to call proc in package having input as accociative array

Hi,
I want to call a proc inside a package having input paramter as accociative array.How can it be called.?
The signature of package is as follows
TYPE ar_line_details_rec IS RECORD (
mfg_part_num VARCHAR2 (100),
description VARCHAR2 (1000),
line_amount NUMBER (14, 2)
TYPE ar_line_dtls_tab IS TABLE OF ar_line_details_rec
INDEX BY BINARY_INTEGER;
PROCEDURE dca_saf_feedback_pr (
p_dca_id IN dca_header.dca_id%TYPE,
p_memo_number IN dca_header.memo_number%TYPE,
p_memo_amt IN dca_header.memo_amt%TYPE,
p_memo_created_date IN dca_header.memo_created_date%TYPE,
p_ar_line_dtls IN ar_line_dtls_tab,
p_code IN NUMBER,
p_mesg IN VARCHAR2,
p_rtncode OUT NUMBER,
p_rtnmessage OUT VARCHAR2
I want to calls the proc dca_saf_feedback_pr .So can it be done?
Thanks,
Tanmoy

Yes, %TYPE is not required here.
-- If your package name is DCA_SAF_FEEDBACK_PKG & you want to pass associative array as assoc
DECLARE
-- declare associative array
  assoc dca_saf_feedback_pkg.ar_line_dtls_tab;
  retcode VARCHAR2(200);
  remsg   VARCHAR2(200);
BEGIN
-- initialize associative array
  assoc(1).mfg_part_num:=10;
  assoc(1).description :='assoc';
  assoc(1).line_amount :=1000;
--pass associative array
  dca_saf_feedback_pkg.dca_saf_feedback_pr (
          p_dca_id =>1,
          p_memo_number => 2,
          p_memo_amt => 200,
          p_memo_created_date=> SYSDATE,
          p_ar_line_dtls =>assoc,
          p_code=> 100,
          p_mesg =>'assoc',
          p_rtncode => retcode,
          p_rtnmessage =>rmsg);
END;Regards,
Ankit Rathi
http://theoraclelog.blogspot.in

Similar Messages

  • Help: How to call a plsql Package on click of a button in ADF

    Hi Guru's
    Please provide your suggestions, how to go ahead in ADF to call a plsql package when a button i clicked.
    I do have a knowledge of oracle callable statment to call the plsql package but not having any idea how to relate button click event in ADF.
    Thanks,
    SPC

    Create a service method in your Application Module to [url http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadvgen.htm#sm0297]call the stored package, expose that service method on the client interface, and then drag the service method from the data control palette on to your page as a button.
    John

  • Purchase Order - How to call customised PO_COMMUNICATION_PVT package?

    We need to add additional fields to the Standard Purchase Order that is produced by using View Document on the PO form. The only suggestions in the forum so far are to modify the PO_COMMUNICATION_PVT package or the PO%XML views.
    But the option of overwriting the seeded package or view is not possible for us. We can only customise the package and compile it under a different name, eg XXPO_COMMUNICATION_PVT. My question is: what changes are needed so that the PO_VIEW_DOCUMENT function calls this new package?
    What modifications to the xml and/or java classes are needed? Are there any specific things to look out for so that the java classes compile properly.
    Any help much appreciated. Thanks.

    Welcome to the forums !
    Pl see if MOS Doc 305307.1 (How To Modify Print PO Report POXPOPDF With Custom Template) can help
    HTH
    Srini

  • How to call procedure and package in BI

    IN OBIEE how to call procedure- function and pass parameter in it.??
    Thanks
    Jatin.

    Do you mean DB function. Check this link:
    http://oracle-bi.siebelunleashed.com/articles/callingdb-function-in-obiee/
    For OBIEE 11g, you have additional options to make calls with Action Framework. For now, I think the above link will help.
    If helpful pls mark as correct or helpful

  • How to call URL to collect user input ?

    Hi all,
    I am writing a Swing applications and at some points, I need to call a URL (external web page) to collect user input. It invokes passing certain parameters to web page so that the web page can be displayed in some certain form. After the user input all data in web page, press "submit", my Swing application needs to get the input back. I suppose that calling URL is trivial but how can I get the input back ? Any input will be greatly appreicated.
    Note: the web page will be displayed in one JFrame but it may not related to this problem.
    C.K.

    response.sendRediresc("http://.......);
    public void sendRedirect(java.lang.String location)
                      throws java.io.IOException
        Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.
        If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
        Parameters:
            location - the redirect location URL
        Throws:
            java.io.IOException - If an input or output exception occurs
            java.lang.IllegalStateException - If the response was committed or if a partial URL is given and cannot be converted into a valid URL

  • How to call a logic package from another piece of logic

    Hello Everyone,
    I have two pieces of logic that I am running. One is a push to Finance logic that is in my payroll application (PushToFinance.lgx). It is supposed to push the data from Payroll to specific accounts within the Finance application. Within that logic I have a run logic statement that calls another piece of logic that is on the Finance application (ClearPayrollBalances.lgx). This logic is called to clear the destination application (finance) data intersections and then push the data values from Payroll to Finance. However, No matter where I put the run logic that calls the ClearPayrollBalances.LGX it clears the balances as the last step in my logic execution. I have commented it the Runlogic statement the data is pushed to the Finance application. I need to have the data intersections cleared before the Push. Any suggestions on how to make this work?
    {******************************* Push Logic Here PushToFinance.LGX *************************************
    //Planning - move data accumulated in InputorLoad member of DataSrc to the Finance App
    //Clear Finance App
    //Ran to clear data intersections in the Finance Application before Push to Finance Logic.
    *RUNLOGIC
    *APP=Finance
    *LOGIC=ClearPayrollBalances.LGX
    *ENDRUNLOGIC
    *COMMIT
    // Move Payroll Data to Finance App
    *DESTINATION_APP=Finance
    //Dims not used in Finance
    *Skip_Dim=JobTitle
    *Skip_Dim=PayPosition
    //New Dimensions in Finance
    *Rename_Dim PayAccount = AccountExp
    //Select only the accounts to be pushed to Finance
    *CALCULATE_DIFFERENCE=0 
    *Select(%PushAccnts%,"[ID]","PayAccount","FinAccount <>''")
    *XDIM_MEMBERSET PayAccount = %PushAccnts%
    *XDIM_MEMBERSET RptCurrency = LC  //only get LC in case FX conversion is used in the future
    *XDIM_MEMBERSET DATASRC = InputorLoad
    *XDIM_MEMBERSET TIME = %PREFIX%.JAN,%PREFIX%.FEB,%PREFIX%.MAR,%PREFIX%.APR,%PREFIX%.MAY,%PREFIX%.JUN,%PREFIX%.JUL,%PREFIX%.AUG,%PREFIX%.SEP,%PREFIX%.OCT,%PREFIX%.NOV,%PREFIX%.DEC                                                                               
    *WHEN DATASRC
    *IS InputorLoad
             *REC(FACTOR=1,DATASRC=PAYAPP,PayAccount=PayAccount.FinAccount)  //save to a different datasrc
    *ENDWHEN
    *COMMIT
    ********************************End Push Logic********************************
    *******************************Begin Clear Logic ClearPayrollBalances.Lgx **********************************
    //This is called from the Payroll application in the Destination  (FINANCE) App
    // Clear Payroll Balances before Payroll PushToFinance Logic populates Finance Application
    // Calling logic passes the Organization set
    *XDIM_DEFAULT ORGANIZATION=NOORGANIZATION
    *XDIM_MEMBERSET ACCOUNT=A_90020000,A_90022000,A_90030000,A_90031000,A_90031500,A_90032000,A_90032500,A_90033000
    *XDIM_MEMBERSET CATEGORY=BUDGETWORKING                                                                               
    *XDIM_MEMBERSET DATASRC=PAYAPP                                                                               
    *XDIM_MEMBERSET RPTCURRENCY=LC
    *WHEN DATASRC
             *IS PAYAPP
             *REC(FACTOR=0)
    *ENDWHEN}

    Thanks for the feedback. I figured out what you meant. I am adding it to Default logic and calling both pieces of logic from a new logic file. I am writing the steps out for others who may need it !
    1.     Create a separate logic file in Payroll called u201CPushtoFinanceu201D and add the Push section.
    2.     In your Default logic in Payroll, have two RUNLOGIC statements, first for the Finance Clear logic and then second for the Push Logic.
    *RUNLOGIC
    *APP=FINANCE
    *LOGIC=ClearPayrollBalances.LGX
    *ENDRUNLOGIC
    *RUNLOGIC
    *LOGIC=PushtoFinance.LGX
    *ENDRUNLOGIC

  • How to plot XY graph from 2 input of dynamic array ? ...

    I have 2 problem when I plot XY graph with 2 dynamic array :
    - I want to make the graph look like sweep chart. But it's seem not possible to use waveform graph?
    - The graph shoul move from left to right , then right to left, then left to right,.....
    Any one can give me some hints?  Thanks alot.
    Attachments:
    U1.PNG ‏21 KB
    XY radom value input.vi ‏147 KB

    I have to make Y change  from 0-10, then 10-0,.... Any one can help me to make it better?
    - How I shift the graph?
    Attachments:
    working_increse_decrease.vi ‏20 KB

  • How to call a procude in oracle and return an array

    I need to call a procedure and return an array, can give some example code?

    First create ArrayDescriptor
    like:
        public ArrayDescriptor createDescriptor(Connection con, String typename) throws SQLException
            if(typename==null)
                return null;
            //WARNING! typename should be in upper case only! Otherwise Exception "invalid name pattern"
            //will be thrown!
            return ArrayDescriptor.createDescriptor(typename.toUpperCase(),con);
        }Then use SetArray function to a prepared query (just like SetInt() or
    SetString()):
    public void setArray(PreparedStatement st, int index, Object [] value, ArrayDescriptor ad) throws SQLException
            ARRAY array = new ARRAY(ad, st.getConnection(), value);
            if(st instanceof OraclePreparedStatement)
                OraclePreparedStatement opst=(OraclePreparedStatement )st;
                opst.setArray(index, array);
            else
                throw new SQLException("Oracle JDBC driver required to support setArray() operation!");
        }In the same way you could implement RegisterOutParameter() which
    accepts Array - it's provided by class OraclePreparedStatement...
    look Oracle JDBC manuals - everything is there.
    Enjoy!
    Paul

  • How to call a package in a trigger

    I have package that is called via a "Submit" in a from used to enter daily production. We are implementing a barcoding system that will automatically populate the tables behind this form (one header and one line level table). I need to write a trigger or something that fires up the code behind the 'Submit' process whenever these tables are updated.
    Is there a way to do this by calling the package in a trigger?
    Please help.
    Thanks
    Edited by: asgar_amin on Feb 3, 2009 10:50 AM

    I'm not quite sure what your requirement is.
    Do you want to know which forms-trigger you can use to call your submit-package, or do you want to know how to call the submit-package from a database-trigger?
    If the second one, it depends on what parameters your package-procedur/function gets as IN-parameters. Is it the ID of the header-record, the detail-record or no parameter at all.
    Depending on that you could either use a AFTER-STATEMENT-trigger on either Header or lines-tables, or if you have to gather the ids a combination of a BEFORE-STATEMENT, an AFTER-INSERT FOR EACH ROW and an AFTER-STATEMENT-trigger.
    To go more into detail, please provide some more information.

  • How to call a Oracle Proc,which contains Object Type as in Param, from java

    Hi
    Would like to know how to call a Oracle Procedure which contains the Object Type Parameter from java.
    Here is my code will look like...
    1. CREATE OR REPLACE TYPE emp AS OBJECT
    Empno NUMBER,
    Ename VARCHAR2(50)
    [COLOR=royalblue]In step1 I have created object type.[COLOR]
    2.CREATE OR REPLACE PACKAGE ref_pkg IS
    TYPE tab_emp IS TABLE OF emp;
    END ref_pkg;
    [COLOR=royalblue]In step2,I have created a table type which is of type emp;[COLOR]
    3. CREATE OR REPLACE PROCEDURE p_emp(p_emptab IN ref_pkg.tab_emp) as
    BEGIN
    FOR I IN 1..p_emptab.COUNT
    LOOP
    Some code written here
    END LOOP;
    END;
    [COLOR=royalblue]In step3 I have passed tabletype which is of type emp as argument.[COLOR]
    Now I need to invoke this procedure from JAVA.
    Calling a procedure doesn�t matter.
    But how I can map objecttype ? how will java recognize oracle object ?
    How can I implement this ?
    Any Help/Clues is Appreciated.
    Thanks
    Krishna

    Hi Bob
    You can call a stored proc from a database control with the jc:sql annotation itself.
    Assume a stored proc taking one In parameter
    * @jc:sql statement="call sp_updateData({id})"
    void call_sp_updateCust(int id);
    You can even call stored proc with OUT parameters using
    * @jc:sql statement="{call sp_MyProc(?, ?)}"
    void call_sp_MyProc(SQLParameter[] params)
    You can also call stored functions via db control.
    More info and diff ways to call at
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
    Thanks
    Vimala

  • Call proc from a package

    I had a package with several procedures. Now, the requirement is to include a call to a new standalone procedure not a part of the package.
    The proc in the package has the cursor and I need to use this data into the proc I called from main, but out of the package.
    This is a sample. Please, do not correct if there's a the syntax gap. I need the principle how to call proc1, proc2, with the same cursor data gathered from main which is still in the package.
    Here is the sample:
    create package body my_package as
    procedure main as
    cursor abc
    select * from my_table where date > sysdate-1;
    begin
    v_rec_type := rec;
    --( v_rec_type is declared in the packade header as my_table rowtype variable)
    for rec in... loop
    If rec.type = 1 then
    proc1;
    elsif rec.type = 2
    proc2;
    else
    null;
    end if;
    end loop;
    end main;
    end;
    create procedure proc1 as
    v_rec_type my_table%rowtype;
    begin
    if v_rec_type.data_1 = 'INS' then
    do this;
    else
    do that;
    end if;
    --do some stuff
    end;
    Thanks a lot for the help.mj

    Well, I also see the discussion on OraFAQ, but your original question said:
    --v_rec_type is declared in the packade header as my_table rowtype variable)
    If you have this variable declared in the spec, you can access it from the other procedure since you are populating it in the procedure in the package. It doesn't matter that the cursor declaration is not in the spec - the variable is based on the table%rowtype, not the cursor%rowtype. Based on what you have said, there is no need to pass a parameter to the procedure.

  • How to find the name of calling procedure or package?

    Hi all..
    Is it possible to find the name of the calling procedure or package?
    I mean..if proc_1 is calling proc_2 How can i find in proc_2 that proc_1 is calling?
    Proc_2 is being called from different procedures? I need to write to small code which needs to fire depends on the Proc it is calling?
    Please help me to solve this.
    Thanks

    Not sure, if this is what you're looking for
    SQL> create or replace procedure p0 as
      2  begin
      3    dbms_output.put_line(dbms_utility.format_call_stack);
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p1 as
      2  begin
      3    p0;
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 as
      2  begin
      3    p1;
      4  end;
      5  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2    p2;
      3  end;
      4  /
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    3a7f2d618         3  procedure INV_ADM.P0
    39abfeef0         3  procedure INV_ADM.P1
    39c5ae7a0         3  procedure INV_ADM.P2
    3a0f3a538         2  anonymous block
    PL/SQL procedure successfully completed.
    SQL>

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

  • Calling StroreProcedure contain XML as Input and store proce return XML as out-BizTalk

    I have a requirement in BizTalk that
    - I will receive XML from Source and i need to submit this XML data in  SQL storeprocedure  as a parameters and submit data
    Ex: My_SP(myXML xml Input,myXML1 xml OUT)
    Could you please help me how to call storeprocedure and submit XML and how to retrieve XML from SP.

    One of the way is to return xml from stored procedure instead of getting a typed schema
    You can have xml auto defined at stored procedure something like below stored procedure.
    SELECT [Employee_ID] ,[Name] ,[DOJ] ,[Designation] ,[Job_Description] ,cast([Rating] as varchar(100)) as Rating ,[Salary] ,[Last_Modified] ,[Status] ,[Address]
    FROM [Adapt_Doc].[dbo].[Employee] for xml auto, xmlschema
    After that you can directly assign the message to the typed schema something like below
    MessageTypedSQL=MessageUntypedSQl;
    For reference you can look into below MSDN articles
    SQL and XML: Use XML to Invoke and Return Stored Procedures
    Executing Stored Procedures Having a FOR XML Clause
    Thanks
    Abhishek

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

Maybe you are looking for