How to use ExecuteWithParams to pass a list as parameter

Hi All,
I need to have a read-only View from SQL with the following script Select * from XXXX_Table where ID is in (:ID_LIST)"
So for example, the script will be something like "Select * from XXXX_Table where ID is in ('d1','d2') "
How do I compose the parameter :ID_LIST from the frond end? I try to use
OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
operationBinding.getParamsMap().put("ID_LIST", " 'd1','d2' "); // ID_LIST is set to expression (string type) in the view object
It does not work. I also try to use operationBinding.getParamsMap().put("ID_LIST", an_arraylist); not working either.
It is working fine if I input only one ID, i.e operationBinding.getParamsMap().put("ID_LIST", " d1 "). But operationBinding.getParamsMap().put("ID_LIST", " d1, d2 ") doesn't.
I spend several hours in trying all kinds of combination in parameters types(String, Object, Array) and parameters composed, none of them work. I believe the problem is the single quoto...
Any one had soloved it before?

The first thing you need is a Nested Table type in the database. I created one with:
CREATE TYPE vc_arraytype AS TABLE OF VARCHAR2(4000);This allows you to pass arrays to SQL. Now theoretically, you should now be able to do this in the where clause of your View Object's query:
WHERE myfield in CAST(:myArrayParameter AS vc_arraytype)All you should have to do is specify the where clause parameter named myArrayParameter as a java.sql.Array, and ADF should do the conversions properly. But as of JDeveloper 10.1.3.5 it didn't work that way. I don't know if it works in 11g, because I'm not using it very much yet.
So instead, I do some of my own conversions to make this work:
    private Connection getCurrentConnection() throws SQLException {
        PreparedStatement st =
            getDBTransaction().createPreparedStatement("commit", 1);
        Connection conn = st.getConnection();
        st.close();
        return conn;
    private synchronized void setupDescriptor(Connection conn) throws SQLException {
        descriptor = new ArrayDescriptor("COMMON.VC_ARRAYTYPE", conn);
    private Array toArray(ArrayList<String> theArray) {
        Array arr = null;
        try {
            Connection conn = getCurrentConnection();
            if (descriptor == null) {
                setupDescriptor(conn);
            arr = new Array(descriptor, conn, theArray.toArray());
        } catch (SQLException s) {
            s.printStackTrace();
        return arr;
    }

Similar Messages

  • How to use PasswordDigest to pass credentials in client (Jdev)

    Hi',
    I have a secured web service in OSB, and to call it I have created a proxy client in Jdev,
    I am able to call it by passing username/password using PasswordText, now I am not getting
    how to use PasswordDigest to pass credentials, please give me some pointers or sample,
    also do I need to perform some changes in the server before doing this.
    Thanks
    Yatan

    Please help

  • How to use the App Store wish list

    I Can't figure out how to use the App Store wish list...if anybody can answer this for me I would love that.

    Hi dlissor,
    The following article describes the Wish List and how to use it -
    iTunes Store: How to use Wish List
    http://support.apple.com/kb/HT1368
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • How to use select options whitout ranges ie like parameter

    how to use select options whitout ranges ie like parameter and pls send me the code on that
    thanks
    raja.

    hi,
    SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b>
    eg: code
    <b>SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b></b>
    data: itab type table of kna1 with header line.
    select * from kna1 into table itab where kunnr IN s_kunnr.
    rgds
    Anver

  • How to use $FLEX$ to pass FROM and TO param to another FROM and TO param

    Hello All,
    I have 2 parameters from customer and to customer, both these have same LOV,
    I have to add 2 more parameters from location and to location
    If i use $FLEX$.customer_LOV to pass to the from location LOV how can i use $FLEX$ to pass the TO customer LOV to TO Location LOV.
    As per my knowledge $FLEX$ can be passed from top to bottom in the list of parameters.
    Is there any other way to restrict.
    Regards,
    Sandeep V

    Hi,<br /> I am trying to configure BlazeDS with JBOSS Application Server.<br /> I have downloaded BlazeDS binary version - blazeds_bin_3-0-0-544.zip from Adobe. But in the installation steps, it says that copy blazeds.war, samples.war and console.war into <JBOSS_HOME>/server/default/deploy folder. But in this zip, it contains only blazeds.war file only. I have copied it to <JBOSS_HOME>/server/default/deploy folder.<br /><br />I have restarted JBoss. I didn't get any error. But when i give <br /> http://localhost:8080/blazeds ... i am always getting "Page not found 404" error.<br /><br />Please help me, if you have detailed steps to configure BlazeDS on JBoss.<br /><br />Thanks for your time.

  • How to use Print Control in Print List.

    Please any body can explain me how to use print control when creating Print list?
    Thanks in advance.

    Please any body can explain me how to use print control when creating Print list?
    Thanks in advance.

  • How to use setFireActionForSubmit with parameters and capture the parameter

    Hi,
    Can anyone explain how to use setFireActionForSubmit.
    I am extending the Controller of ShoppingCartPG. In the extended controller processRequest method I am adding a button to the table and setting up the setFireActionForSubmit, so when the button is pressed it raises the event associated with the setFireActionForSubmit.
    I need to pass the RequisitionLineId as a parameter which is present in the VO associated with the ShoppingCartPG.
    I have used the following code in processRequest
    =================================
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    super.processRequest(paramOAPageContext, paramOAWebBean);
    OATableBean otbRN=(OATableBean)paramOAWebBean.findIndexedChildRecursive("ItemTableRN");
    OASubmitButtonBean oasb= (OASubmitButtonBean)paramOAPageContext.getWebBeanFactory().createWebBean(paramOAPageContext,"BUTTON_SUBMIT");
    oasb.setID("addnInfo");
    oasb.setUINodeName("addnInfo");
    oasb.setText("Additional Info");
    String pageName = paramOAPageContext.getRootRegionCode();
    Hashtable params = new Hashtable (1);
    params.put ("param1", pageName);
    Hashtable paramsWithBinds = new Hashtable(1);
    paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL(oasb, "${oa.encrypt.current.RequisitionLineId}"));
    oasb.setFireActionForSubmit("addnInfoEvent",params,paramsWithBinds,false,false);
    otbRN.addIndexedChild(oasb);
    =================================
    And in processFormRequest method I am capturing the event "addnInfoEvent" and trying to capture the RequisitionLineId which I have passed it as a parameter.
    This is the code I have used in processFormRequest.
    =================================
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    super.processFormRequest(paramOAPageContext, paramOAWebBean);
    OAApplicationModule localOAApplicationModule = paramOAPageContext.getApplicationModule(paramOAWebBean);
    String strEvent= paramOAPageContext.getParameter(EVENT_PARAM) ;
    if ("addnInfoEvent".equals(strEvent))
    Number localNumber = 0;
    try {
    localNumber = new Integer(ClientUtil.getDecryptedParameter(paramOAPageContext, "param2"));
    catch (Exception e) {e.printStackTrace();}
    String outmsg="Line ID : " + localNumber + ":" + strEvent;
    throw new OAException(outmsg,OAException.INFORMATION);
    =================================
    But I am not able to capture the RequisitionLineId which I have sent as a parameter.
    Can anyone let me know what I am doing wrong.

    Hi,
    This is the requested HTML Code
    ===============================
    <button id="N3:addnInfo:0" class="x7g" style="background-image:url(/OA_HTML/cabo/images/swan/btn-bg1.gif)" onclick="return _chain('submitForm(\'DefaultFormName\',1,{\'param1\':\'${oa.encrypt.current.RequisitionLineId}\',\'serverValidate\':\'1\',\'param2\':\'${oa.encrypt.current.RequisitionLineId}\',event:\'addnInfoEvent\',source:\'N3:addnInfo:0\'});return false;',*'submitForm*(\'DefaultFormName\',1,{\'_FORM_SUBMIT_BUTTON\':\'N34\'});return false',this,event,true)" type="submit">Additional Info</button>
    ===============================
    Hi I am not able to paste the HTML Code..some parts of HTML gets removed automatically when I paste it in the forum.
    Regards,
    Rohit

  • How to use bind variale to create list of values? show date range?

    Hi,
    Dose anybode have a way to get around "bind variables are not allowed in Select statement" when create list of values from select? I have to create this based on who the user (one parameter passed into report) is.
    Another Question:
    I like to current date and current date-30 days on my report, how to achieve this?
    Any help wil be greately appreciated.
    Thanks

    Hi LC...
    Your approach is good...
    but i said to change the column formula not in criteria...
    but i wanted to done this change in fx of Dashboard prompt (presentation variable) column...
    Of course i appreciate your approach... it was simple ...
    Thanks & Regards
    Kishore Guggilla
    KUSHALINC

  • How to use a subscribed IMAP folder list in Mail?

    Macbook, 10.8.2 (upgraded from 10.6.8.), WU-IMAPd, Unix host.  Multiple IMAP clients from OSX and other devices, but this is a query about the Macbook.
    I used mail filtering tools (e.g. procmail for inbound stuff) to auto-magically file much stuff in folders at /home/cookie.hunter/Mail.
    Mail.app shows no signs of recognizing ~/.mailboxlist (a T-birdish convention for identifying "subscribed folders" on a remote IMAPd host and occassionally other MUA clients).
    If 'IMAP Path Prefix' (Preferences / Accounts / Advanced) is set to '/' (the default), Mail.app tries to read every file below /home/cookie.hunter looking for things that appear to be mail folders.  This is undersirable.
    If 'IMAP Path Prefix' is set to 'Mail' (corresponding to /home/cookie.hunter/Mail), Mail.app constrains it's search to that territory.  While this is an improvement over trying to examine many G's of data, the result is the inclusion of many e-mails (the vast majority) that are retained only so that I can reach back in time (using tools other than Mail.app)  to locate historical details.  A smallndser subset of folders contains mail of current interest.
    That's the dilemma.  Does Mail.app contain any mechanism similar to .mailboxlist file?
    Haven't yet tried fooling Mail.app with a sym-link structure for the path prefix.  You'd prefer that these things work the way they're "supposed" to work before inventing kludgey work-arounds.
    No, I can't imagine why I'd want to let my Macbook (which I love) be the primary mail store for my life.  Although I use the Macbook more and more all of the time and it's probably my primary platform these days, it will never be my only platform ..
    Suggestions welcome.  My expectations are ... low.
    Thanks.

    I long ago (10 yrs?) complained that the Subscription List window seemed broken as it showed no folders (after spending time asking for them) and there was no way to alter subscribed mailboxes.  Although my feedback fell on deaf ears, maybe you might find someone willing to fix this for one of Apple's main apps.
    Since you didn't mention this, and it is hard to find, here's how:
    In the usual left hand window, Control-Click on one of the occurences of your IMAP account (for instance, under Inbox).  In the "Account Info" window that pops up, choose the "Subscription List" tab.
    But, I find that window to be empty always.
    I believe that the .mailboxlist file would be managed by the IMAP server, not any client, but I haven't checked the code.  I had always thought the subscribed folders should be unique to each client, but when I've added new clients, I notice I've got my "standard" set of subscribed folders.
    You may have wanted to have
       set mail-subdirectory MAIL
    in your /etc/c-client.cf  file instead of having your mail prefix as MAIL.  But don't do that without researching it on your own.
    A corollary to this issue is that Apple Mail does not allow you to choose which folders are stored on your client.  Either you get all messages of all folders for an account, or none.  Having subscribed folders would make this a little more bearable since you could unsubscribe from folders you might not read for a year.
    RIP, MRC

  • How to use images in drop down list ...

    Hi, i am making a form, which have to include drop down menu with images, for example when you push the drop down list the choices must be small images with vegetables, is it possible to make this with livecycle or with some of adobe products

    See if this will help. There's quite a bit going on in each button, and the settings to make it look right is pretty important. Also, there is a global variable for tracking whether or not the "drop down" is open. There is a good bit of functionality missing from this that would be in a drop down menu, but I think it might suffice as a starting point. Some kind of "scroll bar" would be needed if the list you're using gets too big.
    https://workspaces.acrobat.com/?d=YPkSSODN761QxdnJOO4g7g

  • How to use "create archive" on a list of folders to make separate archives?

    I have a folder of folders that I want to archive, but I don't want to create a big archive of the entire folder. I want to create archives of each folder underneath the top folder (each folder is a separate book). When I try to get the list of folders that I want to archive, and then archive them, it insists on making one large folder containing everything. Isn't there a way to make it loop over the folder results and archive each one individually?

    No loops in Automator yet... though the variable function in Leopard may allow them.
    Until then, you can use an AppleScript for that step. Post a question in the AppleScript forum if you need assistance writing the script.

  • How to use the "Get Shared Variable List" VI on an RT target?

    Hello,
    I'd like to programatically iterate through all the shared variables in a library hosted on my CompactRIO. I dropped the "Get Shared Variable List" VI into my Real-Time VI, but when I tried deploying it, LabVIEW said
    Deploying PRC_GetVarList.viPRC_GetVarList.vi loaded with errors on the target and was closed.
    LabVIEW: Failed to load shared library dscProc.dll:ni_lvdsc_process_GetTagListEnd:C. Ensure that the library is present on the RT target. Use MAX to install NI software or FTP to transfer custom libraries to the RT target.
    LabVIEW: Failed to load shared library dscProc.dll:ni_lvdsc_process_GetTagListBegin:C. Ensure that the library is present on the RT target. Use MAX to install NI software or FTP to transfer custom libraries to the RT target.
    I looked at the MAX Software Wizard, but couldn't find any DSC-related modules. Where should I be looking?
    Thanks!
    Solved!
    Go to Solution.

    Hello,
    The DSC palette is not supported on Real-Time VIs and will lead to errors when deployed.  Unfortunately, to have a successful build you will need to modify your application and remove any of the VIs from the DSC palette on your RT Target.
    Regards,
    M. Whitaker
    ni.com/support

  • How to use session to passing data from one JSP to another JSP

    Dear All, I had create 2 jsp web page and want to do this:
    1. input some data into the text box and click the submit button, the jsp page
    will open another jsp page and send the text box data to the new open jsp page.
    can any one tell me how to open a new jsp web page and reciev data from another jsp page?
    thanks yu very much!
    the question.jsp got some code like:
    <html>
    <input type= 'text' name = 'txtName' size = 10 >
    <input type= 'submit' name = 'submit'>
    <% some jsp code %>
    </html>
    answer.jsp
    <html>
    <%
    some jsp code here
    %>
    </html>

    Contents of HTML forms are transmitted as name-value pairs, so you can call request.getParameter(String name) with your form field's name in order to access its value:
    String textValue=request.getParameter("txtName");Regards

  • Is possible to pass array/list as parameter in TopLink StoredProcedureCall?

    Hi, We need to pass an array/List/Vector of values (each value is a 10 character string) into TopLink's StoredProcedureCall. The maximum number of elements on the list is 3,000 (3,000 * 10 = 30,000 characters).
    This exposed two questions:
    1. Is it possible to pass a Vector as a parameter in TopLink's StoredProcedureCall, such as
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    Vector strVect = new Vector(3000);
    strVect.add(“ab-gthhjko”);
    strVect.add(“cd-gthhjko”);
    strVect.add(“ef-gthhjko”);
    Vector parameters = new Vector();
    parameters.addElement(strVect);
    session.executeQuery(query,parameters);
    2. If the answer on previous question is yes:
    - How this parameter has to be defined in Oracle’s Stored Procedure?
    - What is the maximum number of elements/bytes that can be passed into the vector?
    The best way that we have found so far was to use single string as a parameter. The individual values would be delimited by comma, such as "ab-gthhjko,cd-gthhjko,ef-gthhjko..."
    However, in this case concern is the size that can be 3,000 * 11 = 33, 000 characters. The maximum size of VARCHAR2 is 4000, so we would need to break calls in chunks (max 9 chunks).
    Is there any other/more optimal way to do this?
    Thanks for your help!
    Zoran

    Hello,
    No, you cannot currently pass a vector of objects as a parameter to a stored procedure. JDBC will not take a vector as an argument unless you want it to serialize it (ie a blob) .
    The Oracle database though does have support for struct types and varray types. So you could define a stored procedure to take a VARRAY of strings/varchar, and use that stored procedure through TopLink. For instance:
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor("ARRAYTYPE_NAME", dbconnection);
    oracle.sql.ARRAY dbarray = new oracle.sql.ARRAY(descriptor, dbconnection, dataArray);
    Vector parameters = new Vector();
    parameters.addElement(dbarray);
    session.executeQuery(query,parameters);This will work for any values as long as you are not going to pass in null as a value as the driver can determine the type from the object.
    dataArray is an Object array consisting of your String objects.
    For output or inoutput parameters you need to set the type and typename as well:
      sqlcall.addUnamedInOutputArgument("PERSON_CODE", "PERSON_CODE", Types.ARRAY, "ARRAYTYPE_NAME"); which will take a VARRAY and return a VARRAY type object.
    The next major release of TopLink will support taking in a vector of strings and performing the conversion to a VARRAY for you, as well as returning a vector instead of a VARRAY for out arguments.
    Check out thread
    Using VARRAYs as parameters to a Stored Procedure
    showing an example on how to get the conection to create the varray, as well as
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html on using Varrays in Oracle, though I'm sure the database docs might have more information.
    Best Regards,
    Chris

  • SSIS: How to use one Variable as Input and Output Parameter in an Execute SQL Task

    Hello,
    i need your help,I'm working on this issue since yesterday and have no idea how to deal with it.
    As I already said in the tilte i want to start a stored procedure via a Execute SQL Task which has around 15 prameters. 10 of these should be used as input AND output value.
    As an example:
    i have three  Variable:
    var1    int        2
    var2    int     100
    var3    int     200
    the stroed procedure:
       sp_test
          @var1 int
          @var2 int output
          @var3 int output
       AS
       BEGIN
            SET @var2 = @var2 * @var1
            SET @var3 = @var3 + @var1
       END
    So in the Execute SQL Task i call the Stored Procedure as follwos:
        Exec sp_test  @var1 = ?, @var2 = ? output, @var3 = ? output
    (I use an OLE DB Connection)
    The parameter mapping is as follows:
    User::Var1        input                   numeric              0                 -1
    User::Var2        input/output         numeric              1                 -1
    User::Var3        input/output         numeric              2                 -1
    Now my problem. If i set  Var2 and Var3 as Input parameter the values are still the same after running the package. If i set them to a output value the are both Null because the procedure doesnt get any values.
    I already tried to list them a second time - like
        User::Var2        input                  numeric              1                 -1
        User::Var2        output                 numeric              1                 -1
    or i use a new variable
        User::Var2                  input                  numeric              1                 -1
        User::Var2Return        output                 numeric              1                 -1
    but i alwas get the error
    "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
    Has anybody an idea how I can solve this problem?
    Thanks a lot.
    Kind Regards,
    Alice

    Hi Alain,
    thx for your answer.
    I have around 15 procedures called one after the other to calculated and modify my values. Each procedure is responsible for an other but overlapping set of variables. So i thought it would be a good idea to call them one after the other with the needed variables via a execute sql task.
    So if i use a result set, how i get my stored procedure to return 10 values? I would have to use a Function instead of a procedure, wouldn't i?
    As if i have 15 procedures this would be a lot of work.
    But thanks a lot for the idea. I think an other idea would be to create one function which calls all stored procedures and returns all the calculated values as a result set, wouldn't it?.
    Kind Regards.
    Alice

Maybe you are looking for