Passing OracleCachedRowSet to PLSQL as an in parameter

Can anyone give I am trying to pass a cachedRowSet to plsql. Here is the code:
OracleCachedRowSet ocrs = (OracleCachedRowSet)session.getAttribute("ocrs");
OracleCallableStatement ocs = (OracleCallableStatement)con.prepareCall("BEGIN proc(:2) \n; END;");
          ((OracleCallableStatement)ocs).setCursor(1,ocrs);
ocs.execute();
ocs.close();

Thank's Avi for trying to help. My name is Leon. Here are the infos you requested.
JDBC THIN VERSION : 3.0 with JAVA VERSION : 1.4.1_06-b01
JDBC FILES FOR 10G DATABASE
classes12.jar
classes12_g.jar
classes12dms.jar.
classes12dms_g.jar
ojdbc14.jar
ojdbc14_g.jar
ocrs12.jar
orai18n.jar
Database version is 10G Release 10.1.0.2.0
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile
root cause
java.lang.ClassCastException     at oracle.jdbc.driver.OraclePreparedStatement.setCursor(OraclePreparedStatement.java:1423)
     at org.apache.jsp.exchange_rate_jsp._jspService(exchange_rate_jsp.java:258)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

Similar Messages

  • Does OraOLEDB support passing a Ref Cursor as an IN parameter of a Stored Procedure?

    We have a number of Stored Procedures that take a Cursor as an input parameter. Is it possible to call a Stored Procedure of this type with OraOLEDB? If so could you provide a quick sample using VC++/ATL?
    Thanks...

    Thank you for your reply, Yuancai. It would be very useful if the OLE DB team added such an interface to future versions of TCommand. However, for the time being what is the preferred technique for passing large amounts of data to a stored procedure? For instance we have a number of tables that have fifty or more columns. It would be awkward to call a stored procedure with this many parameters. Ideally, one would want to create a structure as a User Defined Type and pass that as a parameter.
    One approach we though of was to pass a XML string though a CLOB parameter and parse it in either a PL/SQL or Java stored procedure. However, while this approach is novel it is not standard. I've found it best to use standard techniques where possible. Any insight you could give would be appreciated.
    Thanks,
    Bryan Wood

  • Whats the difference betweeen passing the table variable and table valued parameter?

    Hi Everbody
      Can someone one tell me what's the difference between passing a table variable and table valued parameter to a stored procedure or function? Can both be used to pass a table to a stored procedure/function?
    Regards
    Regards

    They are essentially the same. What we call a table variable is a local
    variable. A table-valued parameter is an incoming parameter to the
    procedure. The only difference is that the parameter is readonly.
    When you call a stored procedure, you can pass a table variable as the
    actual parameter. Or a table-valued parameter that you pass on.
    CREATE PROCEDURE nisse_sp @tvp sometype READONLY AS
    DECLARE @local someothertabletype
    EXEC pelle_sp @tvp, @local
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Pass TestStand error type directly into function parameter

    Hi,
    I am using TestStand 4 and Labwindows CVI 8.5.
    I wonder if it is possible to pass Standard Step error type into CVI function parameters.
    I think it would be more simple to pass one parameter instead of passing Error code, Error occurred state and Error message into function prototype.
    I tried to use tsErrorDataType struct defined into tsutil.h into my function prototype.
    In TestStand, I pass Step error type into function parameter but it does not work.
    TestStand displays an error meaning parameters does not match function prototype.
    Thank you for your help.

    Hi Tartempion,
    In order to pass the TestStand Error Container as one parameter to a function in a CVI DLL, you must use a struct that is typedef'ed and create an .fp file that is included as a type library for the DLL. When you create a .fp file to add to a DLL, the DLL will not build unless all structs/enums are typedef'ed. Thus, I wouldn't advise using the tsutil.h because you would have to go through and typedef every single struct and enum in the header file.
    Instead, you can simply create a typedef'ed struct in your projects header file and create an .fp file with the struct specified as a data type. Then in TestStand, when you call the function you would need to ensure that the parameter is of Category "C Struct", and type "Error". The attached zip file contains a CVI 8.5 project that demonstrates this along with a TestStand 4.0 sequence file that demonstrates how to pass the parameter to the function by reference. In case you run into trouble creating the .fp file please refer to the following KnowledgeBase. The instructions are for enums but easily correspond to structs as well:
    TestStand and LabWindows/CVI Enumeration Data Types
    Hope this helps!
    Manooch H.
    National Instruments
    Attachments:
    PassTSError.zip ‏19 KB

  • Passing values to plsql dynamically

    Hai all,
    10.2.0.5 on Sun Solaris 10
    We have a table with around 719 single column values . I need to pass this values
    to a procedure one by one and execute it.
    {code}
    select numid from namet1;
    scott
    tiger
    the above values from the table need to be passed in to the below plsql replacing numid
    exec temp_tgf.pol_indx('&numid','&numid');
    {code}
    Any     idea.
    Kai

    We have a table with around 719 single column values . I need to pass this values
    to a procedure one by one and execute it.
    Which begs the question: why?
    Why would you call a procedure that many times using a value like that?
    That suggests that you may be using that procedure to solve a problem that could be better, or more efficiently, solved in a different way.
    Even if that is a proper need the solution is to use modular solutions. For your use case that would be to create an 'overloaded' version of that procedure that has a collection (e.g. a nested table) as a parameter and that uses code similar to what Frank posted to loop through the nested table to call the existing procedure for each value.
    The overloaded version would also need to include proper exception handling. For example, what if your procedure raises an exception for one of the values? Do you want to continue trying to execute the function for the remaining values? Or you do you want to abandon the entire process?
    What transaction handling needs to be implemented? Where will the COMMIT or ROLLBACK happen?
    The overloaded procedure could take parameters that control the processing based on the above issues. It would either 'abort' or 'continue' if an exception occurred for one value. It could also either COMMIT or ROLLBACK based on a parameter value.
    You could also create another 'overloaded' version of that procedure that would query an appropriate data source, create a collection of values and then call the first overloaded procedure.
    By using a modular approach you get maximum flexibility and keep the functionality of each module well-defined.

  • Passing value from plsql back to UNIX

    I have a shell script which calls out to a plsql program using sqlplus command, but how do I return the values from the plsql program (a simple SELECT statement) back to the Unix script? Thanks.
    James

    Create one UNIX script
    eg :- C2_ATG_Insert.sh
    #!/usr/bin/ksh
    #Variables to store the values
    count=0
    Count_ILX_EXCH=0
    Count_ILX_CBOE_SERIES=0
    Count_ILX_UNDLY_INST=0
    Count_STOCK_TIPS=0
    Count_TIPSSUM=0
    # Block to check whether date is passed as a parameter
    if (($# != 1))
    then
    echo "Usage: C2_ATG_Insert.sh dd-mon-yy"
    exit 1
    fi
    # Assign the trade date to a variable
    Temp_Date=$1
    # Call the sql, Count_Temp.sql with date as parameter
    sqlplus usernam/password@Database_Name @Counts_Temp.sql $Temp_Date
    # remove the blank lines
    sed '/^$/d' Counts_Temp.lst > Counts_C2ATG.lst
    # Store variables from the spooled file which gets generated in Count_Temp.sql into variables defined
    while read myline
    do
    count=$(($count + 1))
    case $count in
    1) Count_ILX_EXCH=$myline ;;
    2) Count_ILX_CBOE_SERIES=$myline ;;
    3) Count_ILX_UNDLY_INST=$myline ;;
    4) Count_STOCK_TIPS=$myline ;;
    5) Count_TIPSSUM=$myline ;;
    esac
    done < Counts_C2ATG.lst
    echo "ILX_EXCH Count $Count_ILX_EXCH"
    echo "ILX_CBOE_SERIES Count $Count_ILX_CBOE_SERIES"
    echo "LX_UNDLY_INST Count $Count_ILX_UNDLY_INST"
    echo "STOCK_TIPS Count $Count_STOCK_TIPS"
    echo "TIPSSUM Count $Count_TIPSSUM"
    if [ $Count_ILX_EXCH -eq 0 ] || [ $Count_ILX_CBOE_SERIES -eq 0 ] || [ $Count_ILX_UNDLY_INST -eq 0 ] || [ $Count_STOCK_TIPS -eq 0 ] || [ $Count_TIPSSUM -eq 0 ]
    then
         echo "*********** Count in one of the tables is Zero *****************"
         exit 1
    fi
    Create the SQL File eg Count_Temp.sql
    SET heading off
    SET VERIFY OFF
    SET PAUSE OFF
    SET ECHO OFF
    SET TIMING OFF
    spool Counts_Temp.lst;
    select count(*) from ILX_EXCH where trade_date= '&&1'
    UNION ALL
    select count(*) from ILX_NONCBOE_SERIES where trade_date= '&&1'
    UNION ALL
    select count(*) from ILX_UNDLY_INST where trade_date = '&&1'
    UNION ALL
    select count(*) from STOCK_TIPS where trade_date = '&&1'
    UNION ALL
    select count(*) from TIPSSUM where trade_date ='&&1
    spool off;
    exit;
    Do reply in case you are unable to undertand any part of the scripts

  • Pass String[] (String Array) type to a parameter in "Edit Action Binding"

    Hi
    Hope you are doing fine. This is very important to me, kindly help me in this regad.
    I have a scenario where I need to pass in a parameter of type String[] that has only one value {"Name"} to a webservice that returns some values.
    I've created a WS datacontrol, dragged and dropped the return value on to a jspx, then it asks me to give the input value
    How do I pass it to the Parameter in "Edit Action Binding"?
    When I say new String[]{"Name"}, it gives me the following error
    Cannot create an object of type:[Ljava.lang.String; from type:java.lang.String with value:new String[]{"Name"}
    Similarly, I hardcoded this value in a managedBean, added it to requestScope/applicationScope and queried it using #{applicationScope.AppCreationBean.epsName}
    But this time, it says, the value is null. I guess the value is not getting initialized properly. But if i hardcode the value in the getter method, I'm again getting the error as above.
    Would some one tell me how to pass an array of type String (ie, String[]) with a value "Name" in the "Edit Action Binding" wizard itself?
    Regards
    RaviKiran

    Hi Frank
    Thanks for the reply.
    Issue resolved by initializing it in the ManagedBean.
    For some reason, when I put it in request/application scopes, it was coming as null, but when I registered the Bean in PageFlowScope, it was working!
    Regards
    RaviKiran

  • How to pass values in select statement as a parameter?

    Hi,
    Very simple query, how do I pass the values that i get in the cursor to a select statement. If table1 values are 1,2,3,4 etc , each time the cursor goes through , I will get one value in the variable - Offer
    So I want to pass that value to the select statement.. how do i do it?
    the one below does not work.
    drop table L1;
    create table L1
    (col1 varchar(300) null) ;
    insert into L1 (col1)
    select filter_name from table1 ;
    SET SERVEROUTPUT ON;
    DECLARE
    offer table1.col1%TYPE;
    factor INTEGER := 0;
    CURSOR c1 IS
    SELECT col1 FROM table1;
    BEGIN
    OPEN c1; -- PL/SQL evaluates factor
    LOOP
    FETCH c1 INTO offer;
    EXIT WHEN c1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(offer);
    select * from table1 f where f.filter_name =:offer ;
    factor := factor + 1;
    DBMS_OUTPUT.PUT_LINE(factor);
    END LOOP;
    CLOSE c1;
    END;

    Hi User,
    You are looking somethuing like this, as passing the values to the Cursor as a Paramter.
    DECLARE
       CURSOR CURR (V_DEPT IN NUMBER)    --- Cursor Declaration which accepts the deptno as parameter.
       IS
          SELECT *
            FROM EMP
           WHERE DEPTNO = V_DEPT;    --- The, Input V_DEPT is passed here.
       L_EMP   EMP%ROWTYPE;
    BEGIN
       OPEN CURR (30);       -- Opening the Cursor to Process the Value for Department Number 30 and Processing it with a Loop below.
       DBMS_OUTPUT.PUT_LINE ('Employee Details for Deptno:30');
       LOOP
          FETCH CURR INTO L_EMP;
          EXIT WHEN CURR%NOTFOUND;
          DBMS_OUTPUT.PUT ('EMPNO: ' || L_EMP.EMPNO || ' is ');
          DBMS_OUTPUT.PUT_LINE (L_EMP.ENAME);
       END LOOP;
       CLOSE CURR;
       DBMS_OUTPUT.PUT_LINE ('Employee Details for Deptno:20'); -- Opening the Cursor to Process the Value for Department Number 20
       OPEN CURR (20);
       LOOP
          FETCH CURR INTO L_EMP;
          EXIT WHEN CURR%NOTFOUND;
          DBMS_OUTPUT.PUT ('EMPNO: ' || L_EMP.EMPNO || ' is ');
          DBMS_OUTPUT.PUT_LINE (L_EMP.ENAME);
       END LOOP;
       CLOSE CURR;
    END;Thanks,
    Shankar

  • How to pass multiple MDX values for a single parameter into a drill-through report?

    I'm thinking this will be an easy question for any experienced SSRS/MDX developers, at least I hope so!  I've created a report that gives the user the option to choose viewing data for the current/active week, or YTD.  Depending on which link the
    user selects, the report simply calls itself and needs to pass in the parameter value for Active week.  If it's active week, the parameter value will simply be "true".  If it's YTD, the parameter value needs to be both "True" and "False" so the current
    week's data is accounted for as well.  I've set everything up except for the final step, and I have no idea what to type into the Value field below.  I've tried different things: false, as you see below (it errors saying I'm missing the parameter
    value), the value in MDX format: =[School Dates].[Active Week].&[True] (it said I was missing a bracket), a 1 instead of the word true (again, missing a parameter value).  Nothing is working.
    So my question is kindof two-fold: 1) how do you pass in the value at all and 2) more specifically, how do you pass in multiple values (both true & false) ??

    I'm sorry for being so dense, but I'm not quite following, although what I've tried makes me think if I can follow you, it will work :)
    To answer your initial questions, you are correct with both your assumptions:
    1) detailType is the parameter that specificies YTD/Weekly, this is a "report defined" parameter that I am using to determine which Row Group to display (either YTD or Weekly)
    2) SchoolDaysActiveWeek is the parameter that is being set to either true or false -- this is a field in the cube that states whether that record is for the current week or not
    So in following your instructions, well that's the problem I'm not quite following :)
    1) When you say Delete the SchoolDaysActiveWeek parameter from the report only, do you mean to mark the parameter as Hidden?  If so, I've done this.
    2) I'm not quite sure where to use the statement you provided me.  You said to put it in the dataset, but I don't know which dataset.  I assume you mean the "main" dataset (as opposed to the hidden dataset that gets generated when you mark a field
    as a parameter).  If this is the case, the only place I could see that would allow you to use such a statement is in the Filter section of the properties.  I tried this, and it did not generate any errors, but it also kept my report groups from displaying
    -- it just showed a blank report, so I think it probably wasn't bringing back any rows to populate them with.
    I also tried going into the Expression section for the SchoolDaysActiveWeek parameter in the second screenshot and placing the statement there.  When I did this and ran the report, I would get the following error:
    The 'SchoolDaysActiveWeek' parameter is missing a value
    So what am I missing!? 
    Also, thanks for taking the time to respond!!

  • Passing single/multiple values to stored proc parameter from crystal report

    I tried below solution posted on this forum to pass either a single value or multi-value to a sql server stored procedure parameter (varchar datatype) from crystal report XI R2.
    In my crystal report , I am displaying all the available parameter values to the user  and the user will select either a single value or multi value.
    This worked when I select single value and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product  1')}
    But this did not worked when I selected multiple values and when I say show sql query in my subreport  I see the following:
    {CALL "XYZ"."dbo"."storedprocedurename";1('Product 1,Product 2')}
    I think it might work if it is as below:*
    For multiple values:
    {CALL "xyz"."dbo"."storedprocedurename";1('Product 1', 'Product 2')}
    Please advise.
    Solution Posted on this forum is as follows:
    Hi,
    As you must be aware of that a crystal report created of a stored procedure will allow only a single value for inserting a multiple value as a parameter in your report and pass those values to your stored procedure please follow the below work around which will be helpful for you.
    Symptom
    In Crystal Reports, you want to pass a multi-value parameter to a stored procedure. The problem with doing so is that Crystal Reports considers the multi-value parameter to be an array.
    How can you pass a multi-value parameter to a stored procedure?
    Resolution
    Here are the steps to pass a multi-value parameter to a stored procedure:
    1. Create a Crystal report, and add a multi-value parameter.
    2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
    //Formula: @JoinFormula
    Join ({?Multi-value parameter array},";")
    ====================
    NOTE:
    In the formula above, a semi-colon (";") is the delimiter.
    ====================
    3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
    4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
    Doing so passes a multi-value parameter to the stored procedure.
    Regards,
    Vinay

    Hi Vinay,
    First you need to make sure the stored procedure accepts multiple values in the fashion 'a','b','c'.
    Then, create this formula in the Main Report:
    numbervar i;
    stringvar s;
    for i:= 1 to ubound({?Parameter}) do
        s := s + "'" + {?Parameter}<i> + "'" + ",";
    left(s,len(s)-1);
    Link this formula to the sub-report's parameter.
    Hope this helps!
    -Abhilash

  • How to pass a form value  as a url parameter??

    I have following form and I want to pass the selected value of the drop down choice in as one of the parameter in the URL. How can I do that ??
    something like proposalid that I have done in the url, I want to pass the selected value of the variable doc_id, when I click the Link button
    <form name = "link" method="POST" enctype="multipart/form-data" action="<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/add_doc.jsp">
    <table>
         <tr> <td class="tableContent"> Doc Identifier: </td>
    <td class="tableContent"> <SELECT name="doc_id">
    <%
         Vector v = iddata.getDocumentIdList(tabName);
         //out.println(v);
         if (v != null && v.size() > 0) {
              for (int i = 0; i < v.size(); i++) {
              Hashtable hash = (Hashtable) v.elementAt(i);
    %>
    <OPTION selected name="id " value="<%=(String)hash.get("DOCUMENT_ID")%>"> <%=(String)hash.get("DOCUMENT_NAME")%></OPTION>
    <% } } else {%>
         <OPTION selected name="id " value="test"> No DocIDs</OPTION>
    <%}%>
    <tr> <td colspan = "2">
         <table border="1" width="200">
              <tr> <td> <input type="text" name="link_file" size="30" value=""/></td><td> <INPUT TYPE=button VALUE="Link..." onClick="window.open('<%= request.getScheme() %>://<%= request.getServerName() %>/webAppCore/common/link.jsp?proposalid=<%=proposalID>','mywindow','toolbar=no,location=no,directories=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20');"></td> </tr>
              <tr> <td colspan = "2">
                   To Create Links: <br>
                   * Select Doc Identifier
                   * Click on Link...to select file within eFile. <br>
                   * Click Add to create the Link <br>
              </td> </tr>
         </table>
         </tr>

    if - in your form declaration - you change your method to GET from POST, it will append the form data onto the URL string instead of putting it in the request header. For instance, if you have a form with an input called THE_INPUT, and you submit to a servlet (or script of some kind or whatever) when the value of that text box is "foo", the URL will be:
    http://www.yourdomain.com/yourservlet?THE_INPUT=foo
    But, if you use the POST method, the URL will just be:
    http://www.yourdomain.com/yourservlet
    Is that what you meant?

  • Passing multiple values to a single input parameter

    Hi folks,
    I have a Microstrategy query successfully passing input parameter to a calculation view.  For example I can pass a movement type to a material movements calculation view input parameter.  However if I try to pick more than one movement type the query then fails; 
    Generated SQL that works looks like this;
    select
    sum(a11.TOTALQUANTITY)  WJXBFS1
    from
    "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', '101')
    a11
    When choosing more than one value in Microstrategy the SQL now fails and looks like this;
    select
    sum(a11.TOTALQUANTITY)  WJXBFS1
    from
    "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', '101'),
    'PLACEHOLDER' = ('$$MoveType$$', '103'))
    a11
    If I cut and paste the SQL and run directly in HANA studio the error is;
    Could not execute 'select sum(a11.TOTALQUANTITY) WJXBFS1 from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER" ...' in 66 ms 361 µs .
    SAP DBTech JDBC: [2048]: column store error: search parameter error:  [2018] A received argument has an invalid value;TABLE/VIEW parameter: ( 'PLACEHOLDER'='$$MoveType$$, 103') not supported
    Is it possible to pass multiple values in a single parameter?  I'm using SP67 for this test.
    Thanks,
    -Patrick

    Ravi, also to answer one of your questions about how this will work in Microstrategy; I just heard back from my Microstrategy developer and he is trying MSTR Freeform SQL query with syntax like this;
    select (sumPAR_TEST.TOTALQUANTITY TOTALQUANTITY
    from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' =('$$MoveType$$', '[Movement Type]')) PAR_TEST
    In this example [Movement Type] is the microstrategy prompt.  Unfortunately though it translates like this which is missing extra single quotes around each value;
    select     sum(PAR_TEST.TOTALQUANTITY)  TOTALQUANTITY
    from     "_SYS_BIC"."development.pr1959/CA_TEST_PASS_PARAMETER"
    ('PLACEHOLDER' = ('$$MoveType$$', ''101', '102''))   PAR_TEST
    instead of what we need which is;
    ('PLACEHOLDER' = ('$$MoveType$$', '''101'', ''102'''))   PAR_TEST
    So at this point we are not sure if this will be possible or not.
    -Patrick

  • Passing multiple values to the QUERY BDOC parameter?

    hi All,
    Below is my Query BDOC Anchor Before Query Execute even handler... I'm trying to pass multiple values to the         bq.Z_PartnerFunction query parameter... i.e. 
    PARTNER_FCT in( '00000012','ZDIVMGR','ZAREADR')
    is it possible without creating new Query Bdoc ?
    ====================================
    Private Sub aempchoicewinTCWSearchTAnchor_beforeQueryExecute(ByRef bq As BusinessQuery, ByRef cancel As Boolean)
    If Not bq Is Nothing Then
            If sWcDummy = "Yes" Then
                    bq.WcDummy = sWcDummy
            End If
            bq.Z_PartnerFunction = "00000012"
            If ctrlZ_Territory.Value <> "" Then
                 bq.PRNB_TerrID = "*" & ctrlZ_Territory.Value
            End If
    End If
    End Sub
    ================================
    Thanks in advance
    Hetal

    Hi,
    it looks that you already enhanced the query BDoc because you have a new query parameter bq.Z_PartnerFunction, right?
    To which BDoc parameter is this BQ parameter mapped? And how looks the related where clause?
    For a single filter normally a "=" operator is used. Therefore your example with "in" won't work.
    If these three partner functions are fixed then you might hardcoded them directly in the where clause (supposed the BDoc is not used somewhere else where you don't want to have this filter).
    Or you might add 3 new BDoc parameters, add 3 new where clauses using a disjunction for them (and using an embracing bracket). In this case always all these 3 BQ parameters need to be filled (or all stay empty) to avoid a SQL syntax error.
    Regards,
    Wolfhard

  • How can I pass dynamic value as a user input parameter in discoverer?

    Hi,
    I have a requirement for a discoverer report like this: The report will display only details for Suppliers that have expired (or soon to be) Insurance details. That is the Expiration Date is less than or equal to the day the report is being run plus any days specified in the Number of Days in the Future Parameter.
    The sample code as:
    SELECT s.segment1 vendor_number
    ,s.vendor_name
    ,flv1.meaning classification
    ,pca.certificate_number
    ,pca.certifying_agency
    ,pca.expiration_date
    ,flv2.meaning status
    FROM ap_suppliers s
    ,pos_bus_class_attr pca
    ,fnd_lookup_values flv1
    ,fnd_lookup_values flv2
    WHERE pca.vendor_id = s.vendor_id
    AND flv1.lookup_code = pca.lookup_code
    AND flv1.lookup_type = pca.lookup_type
    AND flv2.lookup_code = pca.class_status
    AND flv2.lookup_type = 'POS_BUS_CLASS_STATUSES'
    AND pca.expiration_date <= trunc(sysdate) + <No. of Days in the Future>
    order by pca.expiration_date asc
    Now the parameter is Number of Days in the Future (Enter the number days in the future to extract the data. This will default to 0).
    Is it possible in discoverer to do so as in query i do that like a condition as pca.expiration_date <= trunc(sysdate) + <No. of Days in the Future>.
    How can I pass <No. of Days in the Future> as a user input parameter in discoverer?
    Please help.

    Hi,
    All you need to do is to create the condition in the discoverer instead of in the query.
    Create a custom folder containing the following sq (note that i removed the condition)l:
    SELECT s.segment1 vendor_number
    ,s.vendor_name
    ,flv1.meaning classification
    ,pca.certificate_number
    ,pca.certifying_agency
    ,pca.expiration_date
    ,flv2.meaning status
    FROM ap_suppliers s
    ,pos_bus_class_attr pca
    ,fnd_lookup_values flv1
    ,fnd_lookup_values flv2
    WHERE pca.vendor_id = s.vendor_id
    AND flv1.lookup_code = pca.lookup_code
    AND flv1.lookup_type = pca.lookup_type
    AND flv2.lookup_code = pca.class_status
    AND flv2.lookup_type = 'POS_BUS_CLASS_STATUSES'
    Then create a discoverer report using this folder using all fields.
    Create a new calculation as (use this exact syntax):
    Sysdate + :No_of_Days_in_the_Future
    Create a new condition:
    pca.expiration_date <= <your calculation>
    To complete it add a sort as you did in the SQL.
    That's it.
    Tamir

  • Error while passing non built in java type as parameter to webservice

    Hi,
    I am using Weblogic8.1 to deploy my webservice. I have designed Dynamic Proxy client to invoke my webservice. While calling webservice, i am passing array of my POJO class as an input parameter to my webservice and getting below error -
    [java] java.lang.reflect.UndeclaredThrowableException
    [java] at $Proxy0.lookup(Unknown Source)
    [java] at cititru.scan.transScan.createGiService(transScan.java:64)
    [java] at cititru.scan.transScan.main(transScan.java:26)
    [java] Caused by: java.rmi.RemoteException: Failed to invoke; nested exception is:
    [java] javax.xml.rpc.JAXRPCException: web service invoke failed: javax.xml.soap.SOAPException: failed to serialize class [Lcititru.api.interdict.gi.ScannedTextData;weblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=class [Lcititru.api.interdict.gi.ScannedTextData; class context=TypedClassContext{schemaType=['java:cititru.api.interdict.gi']:ArrayOfScannedTextData}
    [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    [java] at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    [java] at weblogic.webservice.core.rpc.StubImpl.throwRemoteException(StubImpl.java:266)
    [java] at weblogic.webservice.core.rpc.StubImpl.invoke(StubImpl.java:251)
    [java] ... 3 more
    In above error message ScannedTextData is my POJO class which i am passing as an array to my webservice.I am using servicegen and clientgen ant task to generate my service. Also i am setting generateTypes=True to generate Serialization class automatically. Please anyone can tell me what's need to be done to resolve the above error.
    I am also pasting code snippet of my Dynamic Proxy client.
    import javax.xml.namespace.QName;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    import javax.xml.rpc.encoding.TypeMapping;
    import java.net.URL;
    import java.util.StringTokenizer;
    import java.util.ArrayList;
    import cititru.api.interdict.gi.*;*
    *import cititru.interdict.gi.*;
    String wsdlURL = "http://localhost:7001/ws_gi_server/GiService?WSDL";
    String namespace = "http://www.bea.com/ws_gi_server";
    String serviceName = "GiService";
    String portName = "GiServicePort";
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    QName service_Name = new QName(namespace, serviceName);
    Service sampleService = serviceFactory.createService(new URL(wsdlURL), service_Name);
    TypeMappingRegistry tmr = sampleService.getTypeMappingRegistry();
    TypeMapping tm = (TypeMapping)tmr.createTypeMapping();
    tm.register(ScannedTextData.class, service_Name, new ScannedTextDataCodec(), new ScannedTextDataCodec());
    /* Service access */*
    *GiServerInterface gi = (GiServerInterface) sampleService.getPort(new QName(namespace, portName),*
    *GiServerInterface.class);*
    */* Service invocation */
    bluReplyData = gi.lookup("MUMBAI",ruleSet,"EXECUTOR1",std);-----
    Regards,
    Ankit

    Hi,
    I am using Weblogic8.1 to deploy my webservice. I have designed Dynamic Proxy client to invoke my webservice. While calling webservice, i am passing array of my POJO class as an input parameter to my webservice and getting below error -
    [java] java.lang.reflect.UndeclaredThrowableException
    [java] at $Proxy0.lookup(Unknown Source)
    [java] at cititru.scan.transScan.createGiService(transScan.java:64)
    [java] at cititru.scan.transScan.main(transScan.java:26)
    [java] Caused by: java.rmi.RemoteException: Failed to invoke; nested exception is:
    [java] javax.xml.rpc.JAXRPCException: web service invoke failed: javax.xml.soap.SOAPException: failed to serialize class [Lcititru.api.interdict.gi.ScannedTextData;weblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=class [Lcititru.api.interdict.gi.ScannedTextData; class context=TypedClassContext{schemaType=['java:cititru.api.interdict.gi']:ArrayOfScannedTextData}
    [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    [java] at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    [java] at weblogic.webservice.core.rpc.StubImpl.throwRemoteException(StubImpl.java:266)
    [java] at weblogic.webservice.core.rpc.StubImpl.invoke(StubImpl.java:251)
    [java] ... 3 more
    In above error message ScannedTextData is my POJO class which i am passing as an array to my webservice.I am using servicegen and clientgen ant task to generate my service. Also i am setting generateTypes=True to generate Serialization class automatically. Please anyone can tell me what's need to be done to resolve the above error.
    I am also pasting code snippet of my Dynamic Proxy client.
    import javax.xml.namespace.QName;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    import javax.xml.rpc.encoding.TypeMapping;
    import java.net.URL;
    import java.util.StringTokenizer;
    import java.util.ArrayList;
    import cititru.api.interdict.gi.*;*
    *import cititru.interdict.gi.*;
    String wsdlURL = "http://localhost:7001/ws_gi_server/GiService?WSDL";
    String namespace = "http://www.bea.com/ws_gi_server";
    String serviceName = "GiService";
    String portName = "GiServicePort";
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    QName service_Name = new QName(namespace, serviceName);
    Service sampleService = serviceFactory.createService(new URL(wsdlURL), service_Name);
    TypeMappingRegistry tmr = sampleService.getTypeMappingRegistry();
    TypeMapping tm = (TypeMapping)tmr.createTypeMapping();
    tm.register(ScannedTextData.class, service_Name, new ScannedTextDataCodec(), new ScannedTextDataCodec());
    /* Service access */*
    *GiServerInterface gi = (GiServerInterface) sampleService.getPort(new QName(namespace, portName),*
    *GiServerInterface.class);*
    */* Service invocation */
    bluReplyData = gi.lookup("MUMBAI",ruleSet,"EXECUTOR1",std);-----
    Regards,
    Ankit

Maybe you are looking for