Resolved: Use value from select list in pl/sql block

Hello,
I have a form with a select list: P18_BONUSTYPE, the values of which come from a LOV.
When the user clicks a button, a page process is used to insert a row into a table.
When I use the :P18_BONUSTYPE bind variable in my insert statement I get an error "Invalid number" I get an "Invalid number" error. I assume that APEX is using the displayed text in that bind variable, not its actual (html option) value.
I checked the HTML of the page, and the correct values are in the select list.
Can someone tell me how to get the value into a bind variable that can be used in a pl/sql block for a page process?
Thanks
Message was edited by:
Neeko
Issue was a value in another item.

Did you tried changing the value using "to_number"? (i.e. to_number(:P18_BONUSTYPE)).
Max.

Similar Messages

  • How to get the value from select list to text box

    Hi,
    I have a select list i want to retrieve the value from select list to text box.
    How can i do that???
    Regards,
    Sakthi.

    Hi Sakthi,
    Yo can use the Java script for that..
    Dynamically the value will come into text box.
    Use the below script.
    <script type="text/javascript">
    function disFormItems()
    var lReturn = $v(here your select list name)
    alert(lReturn);
    document.getElementById(here your text box name).value =lReturn; }
    </script>Cheers,
    Shan

  • How do I create a series of text frames using values from Excel list?

    First of all, this is the very first script I'm attempting to write from scratch. I'm completely green at scripting, and I've picked up a few snippets from Adobe's ID scripting guide, but nothing has really stuck yet relating to this particular objective.
    My supervisor keeps a master list of ad spaces, with the name of the account, how wide the space is, and how tall the space is, all in an Excel sheet. These spaces can number in the hundreds, and I am stuck manually drawing one rectangle for every space, which takes a very long time.
    I'd like to create/have help creating a script that will take these values and "automagically" draw these spaces in the form of text frames, with the width (in columns) and the height (in inches) defined by the values in the master list, as well as the name of each account appearing in the subsequent text frames.
    The script doesn't necessarily need to be able to pull the values straight from the Excel sheet; I can transfer the values to a support text file if needed, or directly into the script, changing it as I need it. A big thing (if it is not able to pull right from an Excel sheet) is that the number of spaces changes weekly, and so do the accounts, and the width and the height. Accordingly, it would be ideal if the values from the sheet could be changed easily, so as to create a new set of spaces as needed.
    Positioning for each space is not crucial, only height and width. If they all appear on top of each other on the same page, that will be a result for me. The main idea is to not have to draw them all manually, one by one.
    To me, this sounds like a tall order, but hopefully some experienced scripters out there can assist me, as I wish to become experienced as well.
    So, the TL;DR version:
    - Script needs to draw a series of text frames.
    - Text frames dimensions need to be defined by width and height values from Excel sheet.
    - Text frames must have account name as contents (from account names in Excel sheet).
    - Accounts, width and height change every week in the Excel sheet, so must be relatively easy to exchange all of the values.
    - The width values are on the Excel sheet as columns. It would be ideal if the script could convert those numbers into multiples of columns as needed.
    - (Optional) Script can pull values directly from Excel sheet.
    - (Optional) Script can define text frame fill color as gray. (If it works as I think it will, I could just select all the resulting text frames myself and set them all to gray at once... I'm not that lazy )
    Thanks in advance to whomever can assist in any possible way, even if it is just a push in the right direction. This script will save 1-2 hours of tedium every week.

    Sound like the perfect thing for InDesign Scripting.
    I would copy the Excel contents into a text file, to get a format that is easily read from InDesign, and there will automatically be a TAB for each "cell" just using copy/paste.
    Here is a piece of code, that you perhaps could go on with (adding variable to change pages and location on page, and other stuff).
    The readFileLineByLine function, can be easily re-used with any function using "callback". You simply supply the function to it, that you want to be executed for every line of text that is read:
    const COLUMN_WIDTH = 2; // Define the column width in inch
    var pageIndex;
    var textFramesExported; // not implemented.
    // Add a new dokument. Set myDoc to app.activeDocument to use
    // the current document instead of creating a new one.
    var myDoc = app.documents.add();
    // The doSomethingWithTextRow function is called upon for every line of text read.
    readFileLineByLine('c:\\test.txt', doSomethingWithTextRow);
    function doSomethingWithTextRow(row){
        // We expect the text line to be TAB separated (\t = TAB). We get that from just copying the contents of an
        // excel file into a text document.
        var cells = row.split('\t');
        var companyName = cells[0]; // The Company name in the first slot of the array
        var width = COLUMN_WIDTH * cells[1];
        var height = cells[2];
        // Create a new text frame for every row handled
        if (pageIndex==undefined) pageIndex = 0; // Count up when you have exported a number of texts, I leave this for you to do.
        var newTextFrame = myDoc.pages[pageIndex].textFrames.add();
        newTextFrame.contents = companyName;
        // The text frame is created in the top left corner.
        newTextFrame.geometricBounds = [0, 0, height + ' in', width + ' in']; // Top, Left, Bottom, Right
        // You might want to move the textframes to other positions, keeping track of how many you put out per page.
        newTextFrame.move( [10, 10] );
    function readFileLineByLine(path, callbackFn){
        var myFileIn = new File(path);
        if (File.fs == 'Windows'){
            // This was probably added to recognize UTF-8 (even without its start marker?)
            myFileIn.encoding = 'UTF-8';
        myFileIn.open('r');
        var myEncoding = myFileIn.encoding;
        try{
            if (!myFileIn.exists){
                throw('Missing file: ' + myFileIn.fsName)
            var ln = '';
            while(!myFileIn.eof){
                // Read the lines from the file, until an empty line is found [now as a remark].
                ln = myFileIn.readln()
                // if(ln !='' && ln!='\n'){
                   // Call the function supplied as argument
                   callbackFn(ln);
        }catch(e){
            alert(e);
            gCancel = true;
        finally{
            myFileIn.close();
    The file in C:\ in my example was saved as UTF-8 and looks like this (showing hidden characters):
    Message was edited by: Andreas Jansson

  • How to read value from select list

    Hi,
    i'm using jdev 10.1.3.1.0, adf, jsp and struts.
    i've made a simple viewobject 'bestyrer' (danish for department) and it contains a list of all available department in my organization.
    it appears in my jsp page as a dropdown list and when the user chose a specific department all employees in that department are shown as a master detail relationship.
    It works and its standard drag'n'drop in JDev.
    I need to know which department the user have chosen because the information i show to the user depends on it.
    my view look like this:
    SELECT KBestyrer.BESTYRER,
    KBestyrer.NAVN
    FROM K_BESTYRER KBestyrer
    bestyrer is a number and navn is the name of the department.
    the code generated in my jsp based on drag and drop is:
    <html:select property="KBestyrerView"
    disabled="${!bindings[\'KBestyrerView\'].updateable}"
    onchange="DataForm.submit();">
    <html:optionsCollection label="prompt" value="index"
    property="KBestyrerView.displayData" />
    </html:select>
    and the corresponding HTML generated is:
    <select name="KBestyrerView" onchange="DataForm.submit();"><option value="0" selected="selected">0 Vejdirektoratet</option>
    <option value="1">101 København</option>
    <option value="2">147 Frederiksberg</option>
    <option value="3">151 Ballerup</option>
    <option value="4">153 Brøndby</option>
    <option value="5">155 Dragør</option>
    <option value="6">157 Gentofte</option>
    <option value="7">159 Gladsaxe</option>
    <option value="8">161 Glostrup</option>
    <option value="9">163 Herlev</option>
    <option value="10">165 Albertslund</option>
    <option value="104">999 Andet</option></select>
    First of all i don't want the indexed values as values of my individual options but the real values as seen in fron of the name. i.e. 101 147 151 and so on.
    how do i obtain this and how do i read the value the user have chosen?
    hope to receive some help.
    thanks
    br
    kim gabrielsen

    Ok,
    thanks for the pointer. it clearifies a bit but i cannot make it work.
    I've created a second binding as described in the dokument which gives me another binding in the pagedef file:
    <attributeValues IterBinding="KBestyrerViewIterator" id="Bestyrer">
    <AttrNames>
    <Item Value="Bestyrer"/>
    </AttrNames>
    </attributeValues>
    i guess i should be able to reference this binding using 'Bestyrer' as the id.
    in my JSP page i insert the following:
    <html:select property="KBestyrerView"
    disabled="${!bindings[\'KBestyrerView\'].updateable}"
    onchange="inspect(this.form)" >
    <html:optionsCollection label="prompt" value="#{bindings.Bestyrer.getInputValue()}"
    property="KBestyrerView.displayData" />
    </html:select>
    but it fails with an error:
    org.apache.commons.beanutils.NestedNullException: Null property value for '#{bindings'     at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:669)     at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)     at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
    I've tried #{bindings.Bestyrer} and #{bindings.Bestyrer.inputValue()}
    but they fail too.
    so there is clearly something i don't understand regarding this binding stuff.
    Assuming i get this to work how do i actually accesss the value chosen by the user?
    as far as i recall in plain HTML i gave the select list a name like:
    name=MyList
    and called a javascript function like this:
    onchange="inspect(this.form)"
    in my JS function i could access the value like this:
    function inspect(form){
    alert(form.MyList.options[form.MyList.selectedIndex].text)
    but when i name the select list i receive an error:
    javax.servlet.jsp.JspException: Cannot find bean under name MyList     at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:301)     at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:244)     at brugeroversigt.jspService(_brugeroversigt.java:75)     [brugeroversigt.jsp]
    I'm a bit confused here so any input would be appreciated.
    br
    kim gabrielsen

  • How to display a value from Select List by default

    I have a Select List on a form and I need to on page load show an entry from the SL depending on the user Id of the user logged on.  For example, if the SL had 3 entries: 'Div1', 'Div2', and 'Div3', depending on the division the user belongs to (I can determine that from his user Id using a SQL), say, I need to display 'Div2' to the user in the SL instead of the usual NULL or '---- Select Div ----'.  'Div1' and 'Div 3' entries will still be part of the SL, but for user's convenience I need to display their division.
    Any ideas?
    Thanks,

    Hi Ajay,
    you need to specify your apex version, database version and so on to make our help specific.
    Anyhow you can create a page process- for example one at On Load before header.
    For example;
    [code]
    declare
      v_division varchar2(32);
    begin
      --select default division
       select my_division
       into v_division
      from my_division
      where my_division=:APP_USER;
    :P_DIVISION:=v_division;
    end;
    [/code]
    Then in the default of your select list, specify P_DIVISION as the default. Using one of several methods
    Understanding Page-Level Items
    Kofi

  • Get value from select list created using htmldb_item.SELECT_LIST_FROM_LOV

    I have created a tabular form using the HTMLDB_ITEM functions and now in the javascript, I need to determine the value in another column created using the SELECT_LIST_FROM_LOV function and then set the value under certain circumstances. Unfortunately, I do not know the correct syntax. My Javascript function is being called properly, I am just unable to get or set the field.
    I am calling my javascript function from another column on the tabular form passing in the current row number and f09 is my column.
    Below is my code. Unfortunately, none of the below are working.
    function f_setCurrency(a_row)
    var l_Currency = html_GetElement('f09_'+a_row);
    html_SetSelectValue(l_Currency, 2);
    alert(html_GetSelectValue(l_Currency ));
    alert($x(l_Currency).value);
    alert($x('f09_'+a_row).value);
    alert($v('f09_'+a_row));
    alert($x('f09_'+a_row).innerHTML);
    }

    Brian,
    This example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:176
    and this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:160
    may help you.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Select query inside PL/SQL block.

    Hello Experts,
    I am just a beginner with PL/SQL.
    If I write a select query from client like SQL dev and fire it against a database, it gives me result.
    Eg: select * from employee;
    Now when I use the same Query inside a PL/SQL block suppose:
    Declare
    begin
    select * from employee;
    end;
    This gives error on execution, mentioning that an INTO is expected etc...
    I have doubts here:
    1. Can't I use a plain select inside a PL/SQL block (if so why?)
    I know this is kind of very basic question, I tried searching this on the forum but could not find the thread, please redirect me to the link if this is already answered.

    user8578271 wrote:
    Hello Experts,
    I am just a beginner with PL/SQL.
    If I write a select query from client like SQL dev and fire it against a database, it gives me result.
    Eg: select * from employee;
    Now when I use the same Query inside a PL/SQL block suppose:
    Declare
    begin
    select * from employee;
    end;
    This gives error on execution, mentioning that an INTO is expected etc...
    I have doubts here:
    1. Can't I use a plain select inside a PL/SQL block (if so why?) Because when you run a query in a tool like SQL Developer, or SQL*Plus or TOAD etc. then it opens up a cursor and fetches the data into internal memory structures before displaying it, and that is all done automatically and hidden from you. In PL/SQL, there is no interface to display the results of SQL queries, so you have to specifically tell it what to put the data into.
    The syntax is (in basic terms)...
    SELECT column1, column2... columnX
    INTO variables or record structure
    FROM ...Though that can only select a single row of data. If your query returns more than 1 row it will give a TOO_MANY_ROWS exception. If your query returns no rows you will get a NO_DATA_FOUND exception.
    If you need to select multiple rows into variables etc., then you would need to "BULK COLLECT" into a collection/array structure, though this takes up valuable memory on the server and shouldn't be used unless necessary (and you understand the implications of doing it).

  • How to update value stored in a table when we select a value from a list

    In my jsp page i have given
    <html:select property="function" >
         <html:option value="select">Select Actions</html:option>
    <html:option value="open">Marks as open</html:option>
    <html:option value="closed">Marks as closed</html:option>
    </html:select>
    I am using lookup dispatch action in action class
    public class LoginAction extends LookupDispatchAction{
    protected Map getKeyMethodMap() {
              Map map=new HashMap ();
              map.put("open","open");
              map.put("closed","closed");
              return map;
    public ActionForward open(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
              System.out.println("success");
              return mapping.findForward("success");
         public ActionForward closed(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
              System.out.println("success");
              return mapping.findForward("success");
    but when i select a value from the list,the corresponding action is not occuring.What should i put in my code??

    Put your code between the code tags, it makes it so much easier to read.
    To do that, just highlight your code and click on the "code" found between " and the circled ?.
    From what I can read of your code I don't even see a table or a list, so i have no idea what you are trying to do. You probably need to show more code.
    JSG

  • How to use value from Custom Select tag

    Hi,
    I have made a custom tag for html element select. It is a very basic tag with the selection of one vaule. I am able to populate the list using custom tag in JSP but i am not able to optain the value from that. Kindly see my jsp code.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Expenses Report</title>
    </head>
    <body>
    <center>
    <table summary="layout">
    <tr>
    <td>Month:</td>
    <td>
    <tt:Select name="month" from="${ExpensesDBO}"/>
    </td>
    </tr>
    </table>
    <c:if test="${fn:length(param.month) > 0}">
    <table summary="layout" border="1">
    <tr>
    <td align="center">Year</td>
    <td align="center">Month</td>
    <td align="center">Shopping</td>
    <td align="center">Groceries</td>
    <td align="center">Fixed Expenses</td>
    <td align="center">Transportation</td>
    </tr>
    <tt:Expenses var="exp" username="${sessionScope.user}" from="${ExpensesDBO}">
    <tr>
    <td>${exp.year}</td>
    <td>${exp.month}</td>
    <td>${exp.shopping}</td>
    <td>${exp.groceries}</td>
    <td>${exp.fixedExpenses}</td>
    <td>${exp.transportation}</td>
    </tr>
    </tt:Expenses>
    </table>
    </c:if>
    </center>
    </body>
    </html>
    Basically based on the selected value I want to show the same page with the details including page with the default value in select list.
    I have made a generic select custom tag to be used within the application.
    Regards,
    Rahul.

    If both tables come from the same data source, join the two tables in one data set rather than two as shown. If they are from different data sources, use a 'join data set'

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • How to get multiple values from the list

    I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
    <%     // clicked on Select District Button
    Vector vselectedDistrict = new Vector();
    Vector vdistrictID = new Vector();
    String tmpSelectDistrict = "";
    tmpSelectDistrict = request.getParameter("bSelectDistrict");
    if(tmpSelectDistrict != null)
         // get multiple values from the list
         String[] selectedDistrict = request.getParameterValues("usrTDistrict");
         vselectedDistrict.clear();
         vdistrictID.clear();
         if((selectedDistrict != null) && (selectedDistrict.length != 0))
                             for(int i=0;i<selectedDistrict.length;i++)
                   vselectedDistrict.addElement(selectedDistrict);           
              vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
              for(int i=0;i<vdistrictID.size();i++)
                   out.println("district = " + selectedDistrict[i]);                         out.println("district ID= " + vdistrictID.get(i).toString());
    %>
    // get vdistrict from the database here......
    <select name="usrTDistrict" size="5" multiple>
    <%     for(int i = 0; i< vdistrict.size(); i++)
    %>
         <option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
    <%
    %>          
    </select>
    <input type="submit" name="bSelectDistrict" value="Select District">
    Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
    what I got is this error message:
    org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    So where is going wrong and what the message means?. Any help very much appreciated. Thanks

    These are just guesses that might hopefully steer you in directions you haven't looked in yet.
    I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
    Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
    expects a Vector as its second parameter? And returns a Vector?
    I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector?

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • How to get actual value from LOV list

    Like Subject says: How to get actual value from LOV list. Any help will be appreciated.
    Thanks.

    Thanks Shay, I did it with bind variable because I'm not using JSF. Is there any chance to post solution using standard JSTL or HTML expression. I have something like this: LOV displays some Companies names:
    <html:select property="UserJobCompanyId"
                             disabled="${!bindings[\'UserJobCompanyId\'].updateable}"
                             onchange="submitform();">
                  <html:optionsCollection label="prompt" value="index" property="UserJobCompanyId.displayData"/>                                                     
                </html:select>and I want to get CompanyID of selected Company.
    Thanks, again.

  • Getting multiple values from a list box

    Hi,
    I am not able to get multiple selected values from a list box using the getParameterValues(). I used the following code..
    String[] names=request.getParameterValues("lname");
    can anyone tell me what the error is or is there any other way i can get multiple selected values from a list box.
    Thanks
    Satish

    Fragment 1
    This is the JSP Code am using for testing
    <%
    String[] name =request.getParameterValues("D1");
    if(name.length==1)
    String value=name[0];
    Instead of name.lenght==1 try with name!=null
    Fragment 2
    out.println(value);
    replace the above fragment with
    %>
       <%-- print result -->
       <%=name[0]%>
    <%
    Fragment 3
    else
    %>
    The list box D1 is a multiple select list box.
    If it still doesn't work, check that the checkboxes have the same name as well as different values
    <input type="checkbox" name="D1" value="1">
    <input type="checkbox" name="D1" value="2">I hope this helps :-)
    Good luck
    touco
    ps: i want duke

Maybe you are looking for

  • Safari 6.0.5 share with Twitter

    Safari 6.0.5 share with Twitter does not automatically fill the message with the title of the web page you are sharing! please, bring the functionality back!!

  • I removed my "settings" icon

    while trying to jailbreak my ipod touch i some how ereased my settings app alonge with music,itunes store, app store, browser, contacts, and a few other things. i've been looking for solutions ALL day and have found nothing! PLEASE HELP!!!    

  • Report based on two (or more) views

    Hi, Situation is this - I have two views, which have same type and number of rows. My goal is to create a report which has one bind variable (let's say ':query_nr') so, that when :query_nr=1 then report shows data only from the first view, and when :

  • 2 MP4 Videos one plays one does not

    I have two MP4 Videos one playes and one does not. Both are h.264 Baseline profile,  Level 3,  AAC 2 channel audio Every transcode of the movie that will not play fails also. Any help on h.264 setting that Media Manager will take.

  • Using custom compiled kernel from Ubuntu

    I know I could always use my config file and recompile just for Arch, but I'm wondering what the downsides might be to using my bzImage file and doing a mkinitcpio to make the initrd file? They're both 64bit, all set up to use ext4 and ntfs. I am usi