Passing Object parameters to Procedures in Oracle

Hi,
Can any one please provide me with a sample example how to pass object types as parameters (IN) to a procedure/package.
Thanks in Advance.

Here is a simple example
SQL> create or replace type tbl as table of number
  2  /
Type created.
SQL> create or replace procedure proc(pTbl tbl)
  2  as
  3  begin
  4     for i in 1..pTbl.count
  5     loop
  6             dbms_output.put_line(pTbl(i));
  7     end loop;
  8  end;
  9  /
Procedure created.
SQL> exec proc(tbl(1,2,3,4,5))
1
2
3
4
5
PL/SQL procedure successfully completed.

Similar Messages

  • OCI 22303 exception - Pass object to type Record in oracle procedure

    Recently i had my first encounter with ODP.NET and Oracle. I'm developing a a datalayer that can access a stored procedure on an Oracle database.
    The problem i'm having is the following:
    I'm using this method to pass my parameters to the procedure: http://www.codeproject.com/KB/cs/CustomObject_Oracle.aspx
    I have also attempted this approach:
    http://developergeeks.com/article/48/3-steps-to-implement-oracle-udt-in-odpnet
    I always get the message (litteraly):
    Oracle.DataAccess.Client.OracleException: OCI-22303: type &quote;PAC$WEBSHOP_PROCS"."CUSTOMER_IN_RECTYPE" not found.
    It sounds weird to me, but what are the &quotes doing here in the error message I see?
    Some code i use:
    OracleParameter objParam = new OracleParameter
    OracleDbType = OracleDbType.Object,
    Direction = ParameterDirection.Input,
    ParameterName = "PAC$WEBSHOP_PROCS.P_CUSTOMER_IN",
    UdtTypeName = "PAC$WEBSHOP_PROCS.WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE",
    Value = card
    The information i have about the Oracle procedure:
    CREATE OR REPLACE PACKAGE PAC$WEBSHOP_PROCS IS
    TYPE CUSTOMER_IN_RECTYPE IS RECORD
    (CUS_STO_IDENTIFIER NUMBER(2)
    ,CUS_IDENTIFIER NUMBER(6)
    ,CH_IDENTIFIER NUMBER(2)
    ,CH_CARD_VERSION NUMBER(1)
    PROCEDURE PRC$WS_VALIDATE_CARD
    (P_CUSTOMER_IN IN PAC$WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE
    ,P_RETURN_CODE IN OUT NUMBER
    Any help to cover my problem would be greatly appreciated.
    Thx
    Edited by: 836497 on 14-feb-2011 4:36

    The only way to call it as is would be via an anonymous plsql block, where you create the record type inside the block. Interacting with the block via ODP would be limited to scalar values.
    Here's a PLSQL example just to demonstrate. Here, v1 and v2 are bind variables of scalar type, which you'd setup/bind via ODP instead of the SQL prompt as I did, but I thought this might keep things simpler for the example.
    The other choice would be to write a wrapper procedure that takes type OBJECT that you can call from ODP, and inside that procedure convert them to/from RECORD and call the original procedure.
    Hope it helps,
    Greg
    SQL> drop package somepack;
    Package dropped.
    SQL> create package somepack as
      2  type somerectype is record(n1 number);
      3  function somefunc (v1 somerectype) return somerectype;
      4  end;
      5  /
    Package created.
    SQL>
    SQL> create package body somepack as
      2  function somefunc (v1 somerectype) return somerectype is
      3   begin
      4    return v1;
      5   end;
      6  end;
      7  /
    Package body created.
    SQL>
    SQL>
    SQL> var v1 number;
    SQL> exec :v1 := 5;
    PL/SQL procedure successfully completed.
    SQL> var v2 number;
    SQL>
    SQL>
    SQL> declare
      2   localvar1 somepack.somerectype;
      3   localvar2 somepack.somerectype;
      4  begin
      5     localvar1.n1 := :v1;
      6     localvar2 := somepack.somefunc(localvar1);
      7     :v2 := localvar2.n1;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL>  print v2;
            V2
             5
    SQL>

  • Passing Objects to Stored Procedures in SQL Queries: UNREF(REF(o))

    To me it seems that passing an object (type) to stored procedure in a SQL query is quite laborious. See:
    I created the following simple type:
    TYPE LAST AS OBJECT (
    id NUMBER
    defined a function:
    FUNCTION "CHECKLAST" (l LAST)
    RETURN NUMBER
    AS LANGUAGE JAVA
    NAME 'Checker.checkLast(Last) return int';
    created a typed table:
    CREATE TABLE lastTable OF Last;
    inserted some objects:
    INSERT INTO lastTable VALUES (1003);
    NOW! If want to use the StoredFunction I have to use the following syntax:
    SELECT checkLast(DEREF(REF(o)))
    FROM lasttable o;
    That's not very elegant.
    I would expect the follwing to be working:
    SELECT checkLast(o)
    FROM lasttable o;
    Did I do something wrong? Or did Oracle forget to implement the simple syntax?
    Even worse, the DEREF(REF(o)) trick does not work for member functions...
    Regards,
    André

    I did some experiments and can now (partly) answer my own question:
    Indeed, it is possible to declare a function with a parameter passed as reference:
    CREATE OR REPLACE TYPE Point AS OBJECT
    ID INT,
    MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
    Unfortunately, it is not possible to use the REF in PL/SQL directly:
    CREATE OR REPLACE TYPE BODY Point is
    MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
    AS
    BEGIN
    RETURN q.ID - SELF.ID; --Error(5,14): PLS-00536: No navigation through REF
    END;
    end;
    So, for testing purposes I decided to implement a very simple PL/SQL member function:
    CREATE OR REPLACE TYPE BODY Point is
    MEMBER FUNCTION distance(q IN REF Point) RETURN NUMBER
    AS
    BEGIN
    RETURN -1;
    END;
    end;
    BUT: The SQL query without VALUE is still not possible. The query
    SELECT *
    FROM PointTable d, PointTable e
    WHERE d.distance(e) > 0
    renders ORA-00904: "E": invalid identifier
    Somehow the 'e' seems to be misinterpreted completely.
    Illogically, the following query works fine:
    SELECT *
    FROM PointTable d, PointTable e
    WHERE d.distance(REF(e)) > 0
    The illogical thing is that, now 'E' seems to refer to a VALUE and not to REF (because we can use the REF function), whereas in Gaverill's post 'O' seems to refer to a REF (because we can use the VALUE function).
    My intent is to avoid both the VALUE(o) from Gaverill's example and the REF(e) from my example, because both is not intuitive for end users...
    Maybe I have to define a VIEW holding the object values... But then the end user has to use it in the FROM part.
    All in all, there seems to be no elegant solution for passing objects as parameters to functions...
    Regards,
    André

  • Memory leak problem while passing Object to stored procedure from C++ code

    Hi,
    I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code :
    1) created objects in oracle with the help of "create or replace type as objects"
    2) generated C++ classes corresponding to oracle objects with the help of OTT utility.
    3) Instantiating classes in C++ code and assigning values.
    4) calling oracle stored procedure and setting object in statement with the help of setObject function.
    5) deleted objects.
    this is all I am doing ,and getting memory leak , if you need the sample code then please write your e-mail id , so that I can attach files in reply.
    TIA
    Jagendra

    just to correct my previous reply , adding delete statement
    Hi,
    I am using oracle 10.2.0.1 and compiling the code with Sun Studio 11, following is the brief dicription of my code :
    1) create oracle object :
    create or replace type TEST_OBJECT as object
    ( field1 number(10),
    field2 number(10),
    field3 number(10) )
    2) create table :
    create table TEST_TABLE (
    f1 number(10),f2 number (10),f3 number (10))
    3) create procedure :
    CREATE OR REPLACE PROCEDURE testProc
    data IN test_object)
    IS
    BEGIN
    insert into TEST_TABLE( f1,f2,f3) values ( data.field1,data.field2,data.field3);
    commit;
    end;
    4) generate C++ classes along with map file for database object TEST_OBJECT by using Oracle OTT Utility
    5) C++ code :
    // include OTT generate files here and other required header files
    int main()
    int x = 0;
    int y = 0;
    int z =0;
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection* const pConn =
    env->createConnection"stmprf","stmprf","spwtrgt3nms");
    const string sqlStmt("BEGIN testProc(:1) END;");
    Statement * pStmt = pConn->createStatement(sqlStmt);
    while(1)
    TEST_OBJECT* pObj = new TEST_OBJECT();
    pObj->field1 = x++;
    pObj->field2 = y++;
    pObj->field3 = z++;
    pStmt->setObject(1,pObj);
    pStmt->executeUpdate();
    pConn->commit();
    delete pObj;
    }

  • Error while passing date parameters in procedure and commit issue

    Hi
    1) I am doing a archiveing records and pls find my code below and i have couple of issue,pls find my code and want to ensure the commit is happening every 100000 rows inserted but i am archeiving a huge table but when i checks the table frequently it shows 0 records and after it shows count the actual rows around 20 million records.How can i ensure it commiting on every 100000 records. pls find my code my db version is 10g on windows
    CREATE OR REPLACE PROCEDURE doins as
    cnt number:=0;
    FOR x IN (select * from Call_log
    where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY'))
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY');
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    2) Error while passing date as parameter i am getting following errors while passing date parameter pls find my code and errors
    CREATE OR REPLACE PROCEDURE doins(p_date date) as
    cnt number:=0;
    begin
    FOR x IN (select * from Call_log
    where trunc(c_date) = to_char(p_date,'DD-MON-YYYY'))
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where trunc(c_date) = to_char(p_date,'DD-MON-YYYY');
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    end;
    exec doins(11-Aug-2008) then gives
    SQL> exec doins(11-Aug-2008);
    BEGIN doins(11-Aug-2008); END;
    ERROR at line 1:
    ORA-06550: line 1, column 16:
    PLS-00201: identifier 'AUG' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    if i gave exec doins(11-08-2008) it gaves
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'DOINS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    rgds
    rosh

    CREATE OR REPLACE PROCEDURE doins(p_date varchar2) as
    cnt number:=0;
    begin
    FOR x IN (select A.rowid,A.* from Call_log A
    where trunc(c_date) = to_date(p_date,'DD-MON-YYYY'))
    --hope that's c_date columne is   DATE datatype
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where rowid=x.rowid;
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    end;
    thats your correct procedure - but NOT CORRECT ISSUE.
    You should use bulk collect with limit clause and forall clause to do it faster!!! Or Merge clause.

  • Passing multiple parameters to an Oracle procedure

    I'm having trouble passing multiple parameters to a stored procedure in Crystal Reports 2008 (12.2.0.290).
    I'm using an OLE DB (ADO) connection to an Oracle 10g database.
    I have created a stored procedure that has 3 parameters (in out sys_refcursor, in varchar2, in varchar2) and conforms to all of Crystal Reports' requirements for stored procedures.
    When I select my stored procedure in the Database Expert, it prompts me to enter values for both varchar2 parameters. I enter values and everything seems fine. I close the Database Expert.
    Now the stored procedure is listed in the Field Explorer, but I cannot expand the list of fields. There is a plus sign next to the stored procedure, but clicking on it does nothing. I do not get any error messages.
    If I remove one of the parameters from the stored procedure and try again, everything works fine. I've also tried using a variety of parameter types, but this problem occurs every time there are 2 or more parameters (3 including the ref cursor).
    Please help.

    Try a different Database driver...

  • Passing DATE parameters to Oracle Stored Procedures using ADO

    Does anyone know how can I pass a date parameter to an Oracle
    Stored Procedure? The IN parameter of the procedure is of type
    DATE and the ADO parameter is of type DBDate (I've tried Date
    and DBTimeStamp,too). The execution freezes at "Cmd.Execute".
    Can anyone suggest a solution?
    Thanx for any tips

    As far as I know the documentation on CR & stored procedures says that the REF CURSOR has to be a strongly bound one.
    Could you go into a little more detail? Do you mean I should put a multi-valued parameter into a REF CURSOR? Can you post some code snippets here?

  • How to pass array of Object in A Procedure using OCCI.......

    I m also trying for How to pass Object to a procedureb using OCCI...
    Steps....
    1. I created A type.....
    2. Then I created a VARRAY using that Type.
    3.After that I have written An Procedure with object as a parameter..
    now using OCCI how do u bind the parameter with this . plz note that using OTT
    i have already created the class representation of above object type i.e class
    four Files Created 1> demo.h 2>registermapping.h
    3> demo.cpp 2>registermapping.cpp
    After I want to Pass the Values in A Vector...
    vctor<full_name *> vect;
    stmt=con->createStatement("BEGIN Add_Object(:1); END;");
    full_name *name1 = new full_name; //Giving the Error here Given below....
    name1->
    name1->
    Through name1 Which Function I will call in which I will Pass a String....
    like
    name1->readSQL("Sanjay"); Or I have to add a function......
    vect.push_back(name1);
    setVector(stmt,1,vect,"FULL_NAME");
    error C2259: 'FullName' : cannot instantiate abstract class
    can u plz suggest me Why this Error is Giving......?
    How to pass the data?
    setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
    Can u lz Suggest me ASAP....

    hi Nishant ,
    What u have done Now I mm trying ....
    can u Plz Suggest me......
    How to pass and Array of Object in Procedure using OCCI... Doing....
    90% finished Two Error's Are Coming...
    1> If I create the Class then Data Not Inserting table......
    2> If I will create the Class through OTT command.......
    then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
    Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
    But I added this Function Still SAme Error Giving..
    getSQLTypeName(oracle::occi::Environment env, void *schName,
    unsigned int &schNameLen, void **typeName,
         unsigned int &typeNameLen) const
    Plz Suggest me....
    regard's
    sanjay

  • Passing SQL-Parameters to Oracle-Reports from java

    hello,
    i want to write an application in the following way:
    on a java-frontend an user can select values for different
    parameters. these values should be to transferred to the sql-
    query of the reports rdf file. what is the syntax of an
    parameter passed from java to oracle reports.
    does this work with runtime.exec()... ?
    does anybody have an example.
    any help would be very appreciated.
    greetings
    Thorsten Lorenz

    In order to pass the parameters to report rdf, you can create user parameters in the oracle report builder, hook up the parameters with query. For example, you can create user parameter P_DEPTNO, then create a sql query: select * from dept where deptno = :P_DEPTNO. When you run this report, you give P_DEPTNO=10 as parameter, the rdf will generate report that only prints out department 10's information.
    Once you have this kind of report created, you have several ways to achieve what you want.
    1. use rwrun60. In your java program, you can invoke rwrun60 via runtime.exec(cmd) where cmd = rwrun60 report=dept.rdf userid=scott/tiger@orcl destype=file desformat=pdf desname=dept.pdf p_deptno=<value_from_java_app>
    2. similarly, use rwcli60. the cmd would be:
    cmd = rwcli60 server=repserver report=dept.rdf userid=scott/tiger@orcl destype=file desformat=pdf desname=dept.pdf p_deptno=<value_from_java_app>
    3. use rwcgi60. Instead of using runtime.exec, you should use java URL object to run the report in the web environment.
    option 2 & 3 takes advantage of powerful functionality of reports server, and it is much more scale than option 1.

  • Pass Checkbox Parameters from HTML Form to a stored procedure

    I'm still looking for a solution to my forms problem. FYI, I'm not using Applications Express to build my application--I'm using straight PL/SQL. I need to know how to pass checkbox parameters from my Web form. I'm allowing folks to select one or more checkboxes on a form that will call a delete function to delete the selected records. What I read in Oracle's "Database Application Developer's Guide - Fundamentals" isn't helpful to me. If someone would point me to some examples, maybe I could see what I'm doing wrong. Here's what was written in "Database Application Developer's Guide - Fundamentals":
    All the checkboxes with the same NAME attribute make up a checkbox group. If none of the checkboxes in a group is checked, the stored procedure receives a null value for the corresponding parameter.
    If one checkbox in a group is checked, the stored procedure receives a single VARCHAR2 parameter.
    If more than one checkbox in a group is checked, the stored procedure receives a parameter with the PL/SQL type TABLE OF VARCHAR2. You must declare a type like this, or use a predefined one like OWA_UTIL.IDENT_ARR. To retrieve the values, use a loop:
    CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
    AS
    BEGIN
    FOR i IN 1..checkboxes.count
    LOOP
    htp.print('&lt;p&gt;Checkbox value: ' || checkboxes(i));
    END LOOP;
    END;
    SHOW ERRORS;

    I'm not sure I understand what your issue is.
    If your web form has the following checkboxes defined all with the same name:
    <input type="checkbox" name="attrib" value="1">one</input>
    <input type="checkbox" name="attrib" value="2">two</input>
    <input type="checkbox" name="attrib" value="3">three</input>Then you would create and register a procedure to handle the form submission that has a parameter with the name attrib of type owa_util.ident_arr e.g.:
    create or replace procedure handle_form(attrib owa_util.ident_arr) as
      iter number;
    begin
      for iter in attrib.first .. attrib.last loop
        -- do something with attrib(iter)
      end loop;
    end;
    /Now the one problem with this handler (or any form handler for that matter) is that if the user selects none of the check boxes, or no value for any of the expected parameters, the handler would be called with some parameters missing or with out any parameters passed to it, and the call will error out.
    To get around that you need to provide default values for all the parameters passed to your handler including the ident_arr parameters, however with ident_arr parameters that's difficult to do with standalone procedures. If you place your procedure in a package you can define package level variables of the appropriate types that can be used as default values:
    create or replace package my_web as
      empty_arr owa_util.ident_arr;
      procedure handle_form(attrib owa_util.ident_arr := empty_arr);
    end my_web;
    create or replace package body my_web as
      procedure handle_form(attrib owa_util.ident_arr := empty_arr) as
        iter number;
      begin
        for iter in attrib.first .. attrib.last loop
          -- do something with attrib(iter)
        end loop;
      end;
    end my_web;
    /now when you hit the situation where the user doesn't select any check boxes, the call to handle_form won't err out due to missing parameters, and the empty_arr won't have any elements to iterate over so the loop in the procedure body will be fine and you will be able to retrieve each selected check box value from the attrib array when you iterate over it.

  • Utilizing parameters passed into a Stored Procedure

    Ok. I am creating a Stored Procedure working with Java and Oracle 8.1.7. I am passing in multiple parameters to use in creating the query I need. I am also using Intermedia Indexing and am forced, do to specs, to use the NOT IN.
    Question: Can I pass in parameters rather then strings into a Contains(for Intermedia usage) or a NOT IN within the context of a Stored Procedure?
    The Process is now being dynamically created in Java code and the thought is that it will decrease the load to the Oracle server if it is created in a stored procedure. Do to the dynamic nature of this query and the need to use CONTAINS(....., WITHIN) as well as NOT IN/NOT EXISTS, I need to know if this is possible before I begin to rewrite a couple years worth of code.
    Thank you

    Go to asktom.oracle.com and do a search for "varying elements in in list". There are detailed examples of how to do this properly. I'll try a link to one of them but I doubt it will work ...
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2019864::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:210612357425,%7Bvarying%7D%20and%20%7Belements%7D%20and%20%7Bin%7D%20and%20%7Bin%7D%20and%20%7Blist%7D
    Richard

  • Passing array parameters to Stored procedure

    Hi,
    I need to call a procedure repeatedly with different set of parameters. Instead To do this, I can form a parameter arrays and pass it to the procedure. This is working fine with Oracle 8.1.7 database and Oracle 8.1.7 odbc driver.
    Is there any difference in the way 8.1.6 Oracle ODBC driver behave? When we use the same code with 8.1.6 ODBC driver (with either 8.1.6 database or 8.1.7 database), and pass an array of n elements to the stored procedure, first elemet in the array is processed correctly and for the remaining n-1 times the same value is getting used (which leades to a unique constraint violation since procedure in this case does an insert). Soem of our clients are on 8.1.6 and so we need to get this working on it too.
    Also are you aware if Microsoft ODBC driver implements this correctly. When we traced with ODBC trace, it was executing the procedure n times one after the other thereby simulating the effect but poor performance. (MDAC 2.6).
    Is there any extra settings to be done?
    Thanks
    Sree

    Hi Justin,
    When I installed 8.1.6.6 ODBC driver this problem went off, but I recieved another problem.
    I am getting
    "ORA-01460 unimplemented or unreasonable conversion requested"
    on execution of some procedures with parameter arrays. They work fine with 8.1.7.0.
    Any idea? Is it suggested that I use 8.1.7 ODBC driver with 8.1.6 server/client? Will it create some other problem?
    Thanks
    Sree

  • Unable to pass parameters from APEX to Oracle EBusiness suite R12 forms

    Hi
    We are trying to access a standard Oracle EBusiness form i.e. service request and are invoking this Form through a link from APEX.
    We are trying to pass parameters via this URL
    http://abc.oneapps.com:8010/OA_HTML/RF.jsp?function_id=2037&resp_id=50952&resp_appl_id=170&security_group_id=0&lang_code=US&otherparams=INCIDENT_ATTRIBUTE_15=5206
    The EBusiness suite form is launched correctly but we are not able to read the parameter value through custom.pll code.
    if (event_name = 'WHEN-NEW-BLOCK-INSTANCE') then
         IF form_name='CSXSRISR' and block_name='SR_BSC_QUERY' then
              FND_MESSAGE.DEBUG('PARAMETER.INCIDENT_ATTRIBUTE_15');
              FND_MESSAGE.DEBUG(' ');
              --FND_MESSAGE.DEBUG(:PARAMETER.INCIDENT_ATTRIBUTE_15);
              lC_incident_number :=name_in('PARAMETER.INCIDENT_ATTRIBUTE_15');
              FND_MESSAGE.DEBUG('Incident Number'||lC_incident_number);
              IF lC_incident_number IS NOT NULL THEN
                   copy(lc_incident_number,'SR_BSC_QUERY.INCIDENT_NUMBER');
              END IF;     
              FND_MESSAGE.DEBUG(' ');
         END IF;
    END IF;
    Is this the right way of passing the parameters?
    all technical inputs are welcome.
    Regards
    Sam

    Hi
    We are trying to access a standard Oracle EBusiness form i.e. service request and are invoking this Form through a link from APEX.
    We are trying to pass parameters via this URL
    http://abc.oneapps.com:8010/OA_HTML/RF.jsp?function_id=2037&resp_id=50952&resp_appl_id=170&security_group_id=0&lang_code=US&otherparams=INCIDENT_ATTRIBUTE_15=5206
    The EBusiness suite form is launched correctly but we are not able to read the parameter value through custom.pll code.
    if (event_name = 'WHEN-NEW-BLOCK-INSTANCE') then
         IF form_name='CSXSRISR' and block_name='SR_BSC_QUERY' then
              FND_MESSAGE.DEBUG('PARAMETER.INCIDENT_ATTRIBUTE_15');
              FND_MESSAGE.DEBUG(' ');
              --FND_MESSAGE.DEBUG(:PARAMETER.INCIDENT_ATTRIBUTE_15);
              lC_incident_number :=name_in('PARAMETER.INCIDENT_ATTRIBUTE_15');
              FND_MESSAGE.DEBUG('Incident Number'||lC_incident_number);
              IF lC_incident_number IS NOT NULL THEN
                   copy(lc_incident_number,'SR_BSC_QUERY.INCIDENT_NUMBER');
              END IF;     
              FND_MESSAGE.DEBUG(' ');
         END IF;
    END IF;
    Is this the right way of passing the parameters?
    all technical inputs are welcome.
    Regards
    Sam

  • How to Pass Multiple Parameters To ReportReuest Method in Oracle  BI 11g

    Hi,
    Am integrate Oracle BI Publisher 11g via Web Services in Oracle Forms,For that am developing code in PublicReportServiceClient Class. This worked properly with out passing parameter to the report. so how to pass parameters to the report . If Report is requried some Parameters to generate report.
    If any one knows about How to Passing Multiple Parameters to ReportRequest Methos in Oracle 11g. Pls help me.
    Am trying with the below code for PassParameters to ReportReuest Method in Oracle BI 11g. But by using this code am able to pass only one parameter to the Report, not for multiple Parameter Passing.
    ArrayOfParamNameValue PnameValue=new ArrayOfParamNameValue();
    ParamNameValue Namevalue=new ParamNameValue();
    Namevalue.setName("P_SNO"):
    ArrayOfString aos=new ArrayOfString();
    aos.getItem().add("2");
    Namevalue.setValues(aos);
    PnameValue.getItem().add(Namevalue);
    ReportRequest RepReq = new ReportRequest();
    RepReq.setParmeterNameValues(PnameValue);
    Following method  callRunReport() with an array of parameters used in Oracle Bi 10g,To pass multiple report parameters to ReportRequest method.
    public void callRunReport (String reportPath, String[] paramName, String[] paramValue, Stringusername, String password, String format, String template, String outFile)
    try {
    bip_webservice.proxy.PublicReportServiceClient myPort =new bip_webservice.proxy.PublicReportServiceClient();
    // Calling runReport
    ReportRequest repRequest = new ReportRequest();
    repRequest.setReportAbsolutePath(reportPath);
    repRequest.setAttributeTemplate(template);
    repRequest.setAttributeFormat(format);
    repRequest.setAttributeLocale(“en-US”);
    repRequest.setSizeOfDataChunkDownload(-1);
    if (paramName != null)
    ParamNameValue[] paramNameValue = new ParamNameValue[paramName.length];
    String[] values = null;
    for (int i=0; i<paramName.length; i++)
    paramNameValue[i] = new ParamNameValue();
    paramNameValue.setName(paramName[i]);
    values = new String[1];
    values[0] = paramValue[i];
    paramNameValue[i].setValues(values);
    repRequest.setParameterNameValues(paramNameValue);

    Ramani_vadakadu wrote:
    window.open("http://hq-orapp-03.kuf.com:9704/xmlpserver/~weblogic/kufpec/BTA/KUF_CONF_ITINUD.xdo?_xpf=&_xpt=1&_xdo=%2F~weblogic%2Fkuf%2FBTA%2FKUF_CONF_ITINUD.xdo&_xmode=&_paramsP_BTM_ID="+parseInt(document.getElementById('P3_BTA_ID').value)+"&_xt=KUF_CONF_ITINUD&_xf=pdf&_xautorun=true&id=weblogic&passwd=kuf2011","_blank");
    the above code we are using apex JS to BI publisher calling for report as PDF
    i don't know exactly where your parameters , did you customize my link to multiple parameters
    'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO'); 

  • Passing Parameters to Procedure based sub report thru JRC

    Hi
    I am using storedprocedure based main report with a subreport and i am trying to invoke these reports with JRC.
    I am passing parameters to main report then it is asking parameters for subreport then i placed following statement by placing subreport name
    param2.setReportName("detailed_aging_report_wk.rpt");
    but after using this statement it is prompting for main report parameters.
    How i can pass the same parameter values to both main and sub reports?
    Thankyou.

    Here is a snippet code that demonstrates how to pass a parameter to a subreport, you can accommodate it and test it and see if you still have the same behaviour. What you need to do is to add the code to set the parameter of the main report.
    <%
    /* Applies to: XI
    * Date Created: April 4, 2005
    * Description:     This sample demonstrates how to pass parameters to a report that
    *                    contains a subreport using the Crystal Reports Java
    *                    Reporting Component (JRC) SDK.        
    * Author: HP, CW
    try {
         //check to see if the report source already exists
         Object reportSource = session.getAttribute("reportSource");
         //if the report source has not been opened
         if (reportSource == null)
              //---------- Create a ReportClientDocument -------------
              ReportClientDocument oReportClientDocument = new ReportClientDocument();
              //---------- Set the path to the location of the report soruce -------------
              //Open report.
              oReportClientDocument.open("jrc_set_subreport_parameters/jrc_set_subreport_parameters.rpt", 0);
              //Get the report source
              reportSource = oReportClientDocument.getReportSource();
              //Cache report source. 
              //This will be used by the viewer to display the desired report.
              session.setAttribute("reportSource", reportSource);
         //---------- Create the Parameter Field Objects -------------
        //Create a Fields collection object to store the parameter fields in.
        Fields oFields = new Fields();
        //----------- Initialize the parameter fields ----------
        //Set the name and value for each parameter field that is added.
        //Values for parameter fields are represented by a ParameterFieldDiscreteValue
        //or ParameterFieldRangeValue object.
        //NOTE: Be sure to map the names of the parameters and their
        //respective types against the correct type that the parameter
        //field values was defined to accept in Crystal Reports.
        //NUMBER VALUE PARAMETER. 
        Integer numberValue = new Integer("55");
        //STRING VALUE PARAMETER.
        String stringValue = "String parameter value.";
        //BOOLEAN VALUE PARAMETER.
        Boolean booleanValue = new Boolean("true");
        //DATE VALUE PARAMETER.
        Calendar calendar = Calendar.getInstance();
        calendar.set(2004, 1, 17);
        Date dateParamVal = calendar.getTime();
        //DATE-TIME VALUE PARAMETER.
        Calendar calendar2 = Calendar.getInstance();
        calendar2.set(2002, 5, 12, 8, 23, 15);
        Date dateTimeParamVal = calendar2.getTime();
        //CURRENCY VALUE PARAMETER.
        Double currParamVal = new Double(555.99);
        //TIME VALUE PARAMETER.
        Calendar calendar3 = Calendar.getInstance();
        calendar3.set(2002, 5, 12, 13, 44, 59);
        Date timeParamVal = calendar3.getTime();
        //Set all of the parameter values using the utility function.
         //Since we are passing parameters to the subreport, it is here that we set the
         //subreport name; if you are not passing a parameters to a subreport, the
         //report name will be an empty string
         setDiscreteParameterValue(oFields, "NumberParam", "SubreportA", numberValue);
        setDiscreteParameterValue(oFields, "StringParam", "SubreportA", stringValue);
        setDiscreteParameterValue(oFields, "BooleanParam", "SubreportA", booleanValue);
        setDiscreteParameterValue(oFields, "DateParam", "SubreportA", dateParamVal);
        setDiscreteParameterValue(oFields, "DateTimeParam", "SubreportA", dateTimeParamVal);
        setDiscreteParameterValue(oFields, "CurrencyParam", "SubreportA", currParamVal);
        setDiscreteParameterValue(oFields, "TimeParam", "SubreportA", timeParamVal);
        //Push Fields collection into session so it can be retrieved by the viewer and set
        //at view time.
        session.setAttribute("parameterFields", oFields); 
         //Redirect to the viewer page to render the report
         response.sendRedirect("CrystalReportViewer.jsp");
    catch(ReportSDKException sdkEx) {
         out.println(sdkEx);
    %>
    <%!
    * Utility function to set values for the discrete parameters in the report.  The report parameter value is set
    * and added to the Fields collection, which can then be passed to the viewer so that the user is not prompted
    * for parameter values. 
    private void setDiscreteParameterValue(Fields oFields, String paramName, String reportName, Object value) {
         //Create a ParameterField object for each field that you wish to set. 
        ParameterField oParameterField = new ParameterField();
        //You must set the report name.
        //Set the report name to an empty string if your report does not contain a
        //subreport; otherwise, the report name will be the name of the subreport
        oParameterField.setReportName(reportName);
        //Create a Values object and a ParameterFieldDiscreteValue object for each
        //object for each parameter field you wish to set.
        //If a ranged value is being set, a ParameterFieldRangeValue object should
        //be used instead of the discrete value object.
        Values oValues = new Values();
        ParameterFieldDiscreteValue oParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
        //Set the name of the parameter.  This must match the name of the parameter as defined in the
        //report.
        oParameterField.setName(paramName);
        oParameterFieldDiscreteValue.setValue(value);
        //Add the parameter field values to the Values collection object.
        oValues.add(oParameterFieldDiscreteValue);
        //Set the current Values collection for each parameter field.
        oParameterField.setCurrentValues(oValues);
        //Add parameter field to the Fields collection.  This object is then passed to the
        //viewer as the collection of parameter fields values set.
        oFields.add(oParameterField);
    %>
    Cheers

Maybe you are looking for

  • Question regarding Inrefaces:Please GUIDE.

    A question regarding INTERFACES. 'Each interface definition constitutes a new type. As a result, a reference to any object instantiated from any class that implements a given interface can be treated as the type of the interface'. So : interface I{}

  • Change Metadata JCO in Webdynpro application

    Hello all, I am trying to change the metadata jco destination in a webdynpro application. Although I have changed this in property "logical system name" of the dictionary, I am getting this error when I run the application : com.sap.tc.webdynpro.serv

  • Pdf en internet

    no puedo abrir archivos pdf que esten en internet, con win xp, alguien me puede ayudar??, gracias Alejandro

  • Change the design with css

    As in many other threads told, I try to change the color of my E-Recruiting with css. I copied the MIME folder with BSP_UPDATE_MIMEREPOS to my harddisk. After that I imported those files on a personal folder e.g. myroot. After that I changed the BSPT

  • Changes to Delivery after it is sent for Pickup (in EWM)

    Hello Experts, here i have a requirement with my client: Current Landscape:  ECC 6.0 EHP4, EWM 7.0 (on Separate server) Additional data: Implementing HU, RF guided transations Scenario: on 07/20(July 20) Customer create an SO, delivery created in ECC