How to use ExecuteWithParams to make a list as a parameter

Hi all

"I need to have a read-only view of 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: the end of the sling ID_LIST? I try to use

OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
operationBinding.getParamsMap () .put ("ID_LIST", "" d1","d2"" "); ID_LIST has the expression (String) value in the view object

It does not work. I also try to use operationBinding.getParamsMap () .put ("ID_LIST", an_arraylist); does not work either.


It works fine if I entered a single ID, IE operationBinding.getParamsMap () .put ("ID_LIST", "d1"). But operationBinding.getParamsMap () .put ("ID_LIST", "d1, d2") does not work.


I spend several hours trying all kinds of combination of settings composed, that none of them work and the types of parameters (String, Object, Array). I think the problem is the unique quoto...


One had before soloved?

The first thing you need is a type of nested in the database Table. I created a with:

CREATE TYPE vc_arraytype AS TABLE OF VARCHAR2(4000);

This allows you to pass to SQL tables. Now, in theory, you should now be able to do this in the where clause of the your view object query:

WHERE myfield in CAST(:myArrayParameter AS vc_arraytype)

All you have to do is specify the parameter named myArrayParameter as a java.sql.Array clause, and ADF should do the conversions properly. But from 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 much yet.

So instead, I do some of my own conversions to make it 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 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;
    }

Tags: Java

Similar Questions

  • How to use the Listview element and list in Adf

    Hello

    Can someone explain how to use list view and tags to list items in adf to display the data in the table.


    Concerning
    Suresh

    On the error, check your log window, if no content appears then it suggests that an error occurs.

    I built it by hand.

    CM.

  • How to use Windows DVD Maker

    I want to make a dvd with music, pictures and possibly videos one to get their degree.  Only do in Windows DVD Maker?  Also, when I open the DVD maker - it does me not table storyboard or the taskbar.  Help, please.  Thank you

    You can use Windows Movie Maker, if you want a timeline.
    Storyboard and then use create DVD to burn your DVD.

    Windows Vista - put on the road with Windows Movie Maker
    http://Windows.Microsoft.com/en-us/Windows-Vista/getting-started-with-Windows-Movie-Maker

    Or go straight to DVD Maker:

    Windows Vista - Windows DVD Maker - burn video disc
    http://Windows.Microsoft.com/en-us/Windows-Vista/burn-a-DVD-video-disc

    Windows Vista - DVD - video burning - frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/DVD-Video-burning-frequently-asked-questions

    Windows Vista - change Windows DVD Maker DVD-Video settings
    http://Windows.Microsoft.com/en-us/Windows-Vista/change-Windows-DVD-Maker-DVD-video-settings

  • How to use setFireActionForSubmit with the settings and capture the parameter

    Hello

    Can someone explain how to use setFireActionForSubmit.

    I extend the ShoppingCartPG controller. In the extended controller processRequest method I am adding a button to the table and implementation of the setFireActionForSubmit, so when the button is pressed it triggers the setFireActionForSubmit event.
    I need to pass the RequisitionLineId as a parameter which is present in the t associated with the ShoppingCartPG.

    I used the following code in the processRequest
    =================================
    ' public void processRequest (OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    {
    super.processRequest (paramOAPageContext, paramOAWebBean);
    OATableBean otbRN = (OATableBean) paramOAWebBean.findIndexedChildRecursive ("ItemTableRN");
    OASB OASubmitButtonBean = (OASubmitButtonBean) paramOAPageContext.getWebBeanFactory () .createWebBean (paramOAPageContext, "BUTTON_SUBMIT");

    oasb.setID ("addnInfo");
    oasb.setUINodeName ("addnInfo");
    oasb.setText ("additional information");

    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 I capture the event "addnInfoEvent" in processFormRequest method and trying to capture the RequisitionLineId I the past as a parameter.
    This is the code that I used in processFormRequest.
    =================================
    ' Public Sub processFormRequest (OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    {
    super.processFormRequest (paramOAPageContext, paramOAWebBean);
    OAApplicationModule localOAApplicationModule = (paramOAWebBean) paramOAPageContext.getApplicationModule;

    String strEvent = paramOAPageContext.getParameter (EVENT_PARAM);

    If ("addnInfoEvent".equals (strEvent))
    {
    Number format = 0;
    try {}
    Format = new Integer (ClientUtil.getDecryptedParameter (paramOAPageContext, "param2"));
    }
    catch (System.Exception e) {e.printStackTrace () ;}

    String outmsg = "line ID:" + size + ":" + strEvent;
    throw new OAException (outmsg, OAException.INFORMATION);
    }
    }
    =================================

    But I'm not able to capture the RequisitionLineId I sent as a parameter.
    Can someone let me know what I am doing wrong.

    Hello

    Because your table is not a tip so table using a submit button approach will not work because it won't give you rank of reference and you will not be able to enter the id of the corresponding command line, instead you use an icon of the image, which can be created through customization. Let me know if you need help in the code.

    Thank you
    Pratap

  • How to use Windows Movie Maker

    I got my file AVI and MP3 file combined in the timeline and I can play the video in the Timeline and play it with the sound of the MP3.
    But, I can't understand how to configure the AVI/MP3 file so I can upload it to my web site.
    I have Win XP Home SP3, Movie Maker version 5.1
    Thank you
    Bob Burns

    original title: Windows Movie Maker

    Judging by your question, you should be able to just go to save on PC and upload to your site. Director of Windows compiles the avi + mp3 for you as you mentioned earlier, after you have saved on your pc in the edit tab make sure that your blog supports the file type. If this isn't the case, simply type in the free video converter in the search engine.

  • How to use the 'Get Shared Variable list' VI on a target RT?

    Hello

    I would like to browse all variables shared in a library hosted on my CompactRIO programmatically. I dropped the 'Get Shared Variable list' VI in my VI in real time, but when I tried deploying, LabVIEW says

    Deployment PRC_GetVarList.viPRC_GetVarList.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListEnd:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListBegin:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    I watched the wizard of the MAX software, but cannot find the DSC-based modules. Where should I look?

    Thank you!

    Hello

    The palette of DSC is not supported on the screws in real-time and will lead to errors when they are deployed.  Unfortunately, to have a successful build you will need to modify your application and remove the screws from the palette of DSC on your target of RT.

  • How to use data recovery in memory of "D"? The computer did not contain a wrioter of C/D, so I couldn't make a recovery disk.

    How to use data recovery in memory of 'd' (about 10 GB)?

    See if a manual provided with the computer or go to the manufacturer's website, email or you can call for information on how to make a recovery.

    Normally, you have to press F10 or F11 at startup to start the recovery process...

    Another way I've seen on some models is press F8 and go to a list of startup options, and launch a recovery of standards of plant with it, by selecting the repair option.

    Ask your manufacturer of computers for the EXACT method to restore to factory settings.

    This isn't their recovery process, Microsoft.

    See you soon. Mick Murphy - Microsoft partner

  • How to make the list of instrumental music

    How to make a list of all my player someone help

    Alan

    iTunes is not a method to determine what tracks have vocals. You can create a normal playlist and put what you want in it.

    TT2

  • How can I make a list of all bookmarks as my homepage?

    How can I make a list of all bookmarks as my homepage?

    You can set one of these pages as startup page:

    • chrome://browser/content/places/places. XUL
    • chrome://browser/content/bookmarks/bookmarksPanel.XUL

    The first one opens the Manager of bookmarks (library) and the second the bookmarks that see you in the box to Favorites (Ctrl + B; View > sidebars)

  • How make a list of my favorites and save it as a document?

    I have many important sites bookmarked in my Firefox browser. I want to make a list of the links that I have bookmarked so that if any case I surf the net in any other computer, I go to these sites.

    Also, I want to save the links in a type of ms word/all other document, as a backup, too. How could I do it?

    Export bookmarks as HTML

  • I missed the prompt to update my notes. My software is up to date, but there is no option to update notes. How can I get this opportunity again? I want to sketch options and make interactive lists.

    I missed the prompt to update my notes. My software is up to date, but there is no option to update notes. How can I get this opportunity again? I want to sketch options and make interactive lists.

    Open the Notes app and look near the upper left corner to see if the upgrade option is there.

  • I don't know how to add additional devices to my list of "trusted devices" in my Apple account.  When I opened my account on Apple using my apple id, I see only my iphone6 listed as a "trusted device";  There is a button to edit, for example. Delete the d

    I don't know how to add additional devices to my list of "trusted devices" in my Apple account.  When I opened my account on Apple using my apple id, I see only my iphone6 listed as a "trusted device";  There is a button to edit, for example. deleting devices, but I can't, or I do not understand how to add my other devices to my approved devices - but is anyone know how to add my Mac and iPad to this list?

    Download a purchase on a device should associate this device with your Apple ID take a look at this.

    View and delete devices in iTunes - Apple Support

  • How can I get the clips in record full-time instead of the 25seconds (which seems to be set) when using windows DVD maker

    How can I get the clips in record full-time instead of 25 seconds (that they seem to be defined) using windows DVD maker

    Hi LorraineDawson,

    Here's a walkthough troubleshooting on this issue:

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-creating-a-DVD-video-using-Windows-DVD-Maker

    hope this helps

    B Eddie

  • How to use my webcam to make a video?

    Original title: Videos

    I asked 3 times how to use my webcam to make a video. I used for the design of critical systems of path for Lunar Missions manned Apollo and if I had received answers to my questions as answers to engineers gave three first astronauts would be dead.  I went to Georgia Tech and an engineer means something tangible like electrical, Civil, aerospace, industrial etc etc.

    For someone who wants a simple answer, you ask with a lot of extraneous information.

    I responded to one of your other queries (even more) on the same...

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/webcam/7e9e2483-808e-44A6-ac0e-ea7f173410b1

    Also, looking at your profile I don't know WHERE you have asked three times about it - but it was not these forums.  Click on the following link to see your profile and questions you asked, those to which you have subscribed, etc.. :

    http://answers.Microsoft.com/en-us/profile/b724118b-5491-4264-8798-4e4b18d48cdb

  • How make a list with input characters

    I want to make a list where all the ranks of the list composed over one line? How to do this?

    Thanx

    As a first step, make the following changes to your code:

    After

    list = new ListField (itemList.length);

    Add the line

    list.setRowHeight (list.getFont () .getHeight () * 2 + 1);

    Replace:

    String text = itemList [index] + "\n" + "Yes."
    graphics.drawText ("text", 30, 1, 0, width);

    with

    graphics.drawText (itemList [index], 30, 1, 0, width);

    graphics.drawText ('Yes', 30, listField.getFont () .getHeight () + 1, 0, width);

    This will probably not what you want, but it will show you what to change.

    Note the above has not been compiled or tested, perhaps even not compile, but you should be able to understand since the javaDocs.

Maybe you are looking for