Cannot get 'IN' text field with multiple values.

I have a text field (P11_SERIAL_NUMBERS) someone would use to enter multiple values (i.e. of the serial numbers). I tested various methods but can't seem to get anything working. I used values such as ' 12929', '19191' or ('11919', ' 19192 ', ' 1111') or 12121,121333.»

I have to analyze this area after the entrance is and update P11_SERIAL_NUMBER to something like ("121212 ', 121211', '292929'). The report is a SQL query returning the body of a PL/SQL function. I build the query in an anonymous block to something like the following:

SELECT apex_item.checkbox (1, instance_number) Ins,.
apex_item. Text(2,i.instance_number) instance_number.
apex_item. Text(3,i.item_number) item_number.
description of the apex_item. Text(4,i.Description),
Serial_number apex_item. Text(5,i.serial_number),
i.party_name,
i.status_name
Cycsi_item_details_v I have
WHERE i.item_number IN (SELECT v.item_number FROM cycsi_installed_base_v WHERE v.serial_number = i.serial_number v)
AND i.item_number AS NVL ('%' |') XLA' | ' %','%')
AND NOT EXISTS (SELECT d.item_serial_number FROM cy_fco_d, d WHERE d.fco_id = 2803 AND d.item_serial_number = i.serial_number) AND i.serial_number IN ('61763 ', ' 61621');

However, when I enter several values that nothing ever went back to the SUMMIT even though the SQL query returns more rows. I run the application in debug mode and it seems to show the values correctly.

0.11: show report
0.12: determine the column headings
0.12: analyze the query such as: TRAFFIC
0.15: binding: ": P11_MODEL_NUMBER"= "P11_MODEL_NUMBER" value = "XLA"»
0.16: binding: ": P5_FCO_ID"= "P5_FCO_ID" value = "2803"»
0.17: binding: ": P11_SERIAL_NUMBERS"= "P11_SERIAL_NUMBERS" value = '(' 61621', ' 61763')""
0.19: print the column headings
0.19: loop lines: 15 rows
No data found

If I add only a serial number at a time as the APEX application returns the line correctly.


Does anyone have an idea what I'm doing wrong or what best way to solve this problem?
Thank you
John

Published by: Jennifer on July 13, 2010 15:23

Hi John,.

I just tried a report region based on PL/SQL query encoded using your method to refer to element names in the query string of back:

declare
   q varchar2(100) := 'select ename, job from emp';
begin
   if :P2_ENAMES is not null then
        q := q || ' where ename in :P2_ENAMES';
   end if;

   wwv_flow.debug('*** Query: ' || q);

   return q;
end;

As I suspected, he did not work for me P2_ENAMES was ('KING') or ('KING', 'SMITH'). I think it's because of the reason for which I gave in my previous post - ApEx passes off the coast of the dynamic execution of SQL string, it does not automatically replace the mention: P2_ENAMES with the value of the element. I don't know how it can work for you.

If I change the code I proposed:

declare
   q varchar2(100) := 'select ename, job from emp';
begin
   if :P2_ENAMES is not null then
        q := q || ' where ename in ' || :P2_ENAMES;
   end if;

   wwv_flow.debug('*** Query: ' || q);

   return q;
end;

It works very well if one or several names are specified.

I took a blow to modify your code for the construction of the query string - does not immediately guarantee, it'll work because I can't test (might be missing a parenthesis or quotation) it but you should get the idea:

-- start with initial valid query that ApEx can parse to determine column names
q := 'SELECT apex_item.checkbox(1, instance_number) ins, apex_item.text(2, i.instance_number) instance_number,
             apex_item.text(3, i.item_number) item_number, apex_item.text(4, i.description) description,
             apex_item.text(5, i.serial_number) serial_number, i.party_name, i.status_name
        FROM cycsi_item_details_v i
       WHERE i.item_number IN (SELECT v.item_number
                                 FROM cycsi_installed_base_v v
                                WHERE v.serial_number = i.serial_number)';

-- add model number condition if specified
if :P11_MODEL_NUMBER is not null then
   q := q || ' AND i.item_number LIKE ''%' || :P11_MODEL_NUMBER || '''%''';
end if;

-- add serial numbers condition if specified
if :P11_SERIAL_NUMBERS is not null then
   q := q || ' AND i.serial_number IN (' || :P11_SERIAL_NUMBERS || ')';
end if;

-- add FCO id condition if specified
if :P5_FCO_ID is not null then
   q := q || ' AND NOT EXISTS (SELECT d.item_serial_number
                                 FROM cy_fco_d d
                                WHERE d.fco_id = ' || :P5_FCO_ID || '
                                  AND d.item_serial_number = i.serial_number)';

I know that has focused on getting this code works, but I would be remiss in my duties if I didn't at least mention the risk of SQL injection. You may already know this, but unless you do a good job to validate the values of the element used in the query, you could open yourself up to a SQL injection attack. For example, imagine what that would be returned if a hacker sharp entered "12345) GOLD (1 = 1" in the field of P11_SERIAL_NUMBERS - you would get all that may or may not be a security problem.

Hope this helps,
John

Tags: Database

Similar Questions

  • When a box is checked, fill a text field with a value

    I don't know that it's simple; However, I am very new to acrobat and javascript.

    Here's what I want to do:

    I have a checkbox field and a text field. If the checkbox is turned "on" I want to fill the text field with a specific numeric value.  If she isn't 'unchecked' there is not value or value 0.  Any help is appreciated.

    Enter this code in the custom of your text field calculation script:

    This.getField("CheckBox1").value = Event.Value == "Off"? 0: 1234;

  • text field with numeric values for sorting

    I'm having a problem my sort. Usually, when the column follows a format, I can use a combination of INSTR and LPAD to sort correctly. In this new case, my columns does not follow a specific format.

    Sample data:
    with t as(
    select 'xxx 10 MG yyy' sortcol from dual union
    select 'xxx 5 MG yyy' from dual union
    select 'xxx 28 MG yyy' from dual union
    select 'aa 10% 12.5 ' from dual union
    select 'aa 6.25% 12.5' from dual union
    select '222 zzz 30/17.5' from dual union
    select '222 zzz 30/5.5' from dual
    )
    select * from t
    
    SORTCOL
    222 zzz 30/17.5
    222 zzz 30/5.5
    aa 10% 12.5 
    aa 6.25% 12.5
    xxx 10 MG yyy
    xxx 28 MG yyy
    xxx 5 MG yyy
    I want to sort the data in the
    222 zzz 30/5.5
    222 zzz 30/17.5
    aa 6.25% 12.5
    aa 10% 12.5 
    xxx 5 MG yyy
    xxx 10 MG yyy
    xxx 28 MG yyy
    I'm trying to replace all numerical values in the string to have 4 digits. For example:

    xxx yyy MG 0010
    xxx yyy MG 0028
    xxx yyy 0005 MG
    0222 zzz 0030/0017.0005
    0222 zzz 0030/0005.0005

    If Oracle will sort correctly digital in the form of text fields. I thought I found the solution with the regular expression:
    select regexp_replace('x10x100x6.5x','([0-9]+)',lpad('\1', 4,0)) from dual
    
    x0010x00100x006.005x
    But the problem is that the backreference in the LPAD overrides the value before it run LPAD. He treats her like the literal string '\1' as oppose to the reference value: 10, 1, 6, and 5. Therefore, LPAD think length is always 2, length ('\1') = 2 instead of length('100') = 3.

    Is there another method to develop all the numbers? Thank you for your time.

    Hello

    You can do with nested REGEXP_REPLACEs:

    SELECT   sortcol
    ,      REGEXP_REPLACE ( REGEXP_REPLACE ( sortcol
                                 , '([0-9]+)'
                              , '000\1'
                              )
                   , '[0-9]+([0-9]{4})'
                   , '\1'
                   )     AS four_digits
    FROM       t
    ORDER BY four_digits
    ;
    

    You probably don't want to display the string converted; you want to just ORDER BY it. It is included in the SELECT clause only if you could see what it was, for the tests.
    Output:

    SORTCOL         FOUR_DIGITS
    --------------- ------------------------------
    222 zzz 30/5.5  0222 zzz 0030/0005.0005
    222 zzz 30/17.5 0222 zzz 0030/0017.0005
    aa 6.25% 12.5   aa 0006.0025% 0012.0005
    aa 10% 12.5     aa 0010% 0012.0005
    xxx 5 MG yyy    xxx 0005 MG yyy
    xxx 10 MG yyy   xxx 0010 MG yyy
    xxx 28 MG yyy   xxx 0028 MG yyy
    

    As you can see, the inner REGEXP_REPLACE adds 3 leading 0 to each number, if she need to 0, 1, 2, or 3. This means that each number will be at least 4 digits, but maybe more. The external REGEXP_REPLACE replaces 4 digits with the last 4 digits only.

    Thanks for posting the sample data in a useful form. The description of the problem was very clear, and it was useful to see that you had already tried and your results on why it does not work. I wish we could mark questions as "Correct." This one was really were.

    Published by: Frank Kulash, January 21, 2011 16:20

  • Validate a field with multiple values.

    Hi, I have to limit the decimal values to a text entry field that is "number".
    When I click SAVE it will say that the decimal values are not allowed.
    This part is fine. But the problem is that when I record multiple entries (batch record). It validate the first row only, and then according to the first value of the line it throws the exception.

    I use this piece of code to extract the values of "number."

    OAMessageTextInputBean oamessagetextinputbean = (OAMessageTextInputBean) webBean.findChildRecursive ("Number");

    String qty = (String) oamessagetextinputbean.getValue (pageContext);

    But it is only returning a value in the field number. Using this value I validate against the decimal values.

    How to get the value of the field number in the next row. Also, I need to validate as well.


    Quick help is appreciated.

    Thanks in advance.


    Hi Myvizhi/Sushant

    I tried with this piece of code for the above specified task and it worked fine for me.

    public void processFormRequest (pageContext, OAPageContext,

    {OAWebBean webBean)

    super.processFormRequest (pageContext, webBean);

    Am = OAApplicationModule

    (OAApplicationModule) pageContext.getApplicationModule (webBean);

    Oaviewobject = OAViewObject

    (OAViewObject) am.findViewObject ("PoRequisitionLinesVO");

    int rwcnt = oaviewobject.getRowCount ();

    System.out.println ("rwcnt is" + rwcnt);

    Oatablebean = OATableBean

    (OATableBean) webBean.findChildRecursive ("ItemTableRN");

    If (pageContext.getParameter ('Save')! = null |)

    pageContext.getParameter ("Checkout"). = null) {}

    for (i = 0; i< rwcnt="" ;="">

    oaviewobject.getCurrentRow ();

    OAMessageTextInputBean oamessagetextinputbean = (OAMessageTextInputBean) webBean.findChildRecursive ("Quantity");

    String MessageTextValue = oamessagetextinputbean.getValue (pageContext) m:System.NET.SocketAddress.ToString ();

    System.out.println ("Value of mtv is" + MessageTextValue);

    oaviewobject. Next();

    If (MessageTextValue! = null |) MessageTextValue.length ()! = 0) {}

    If (MessageTextValue.contains("."))

    {

    System.out.println ("Value of mtv is" + MessageTextValue);

    throw new OAException ("decimal values not allowed in the quantity field, Try Again", OAException.ERROR);

    }

    }

    }

    }

    }

    }

    Thank you
    Michel

  • fill in the text field with the caption for the radio list

    Hi, I'm looking for an answer to this all morning.  I need to use the value of a list of radio to populate a text field.  I can get the selected numeric value OK with

    $.rawValue = form1. #subform [0]. . Table3.Row1 #SubForm [0]. . RawValue location [0]

    but I want to get the text associated with the value element.  This could be the legend of the selected option button, since it is the same thing.  I don't want to use an if statement because I have a lot of forms to create and that would change things a few times in each shape.  How can I get the value of the text of the column of the item below?

    screenshot.17.png

    Try the following with two modifications to your hierarchy.

    (1) currently, you do not have a name for Page1. Make sure that you assign a name for ease of use. ("Page1").

    (2) define a name for the subform that contains PeriodRadio. ("Subform1").

    $.rawValue = form1. Page1. Table3.row2. Subform1. PeriodRadio.selectedMember (). caption.value.text.value;

    Thank you

    Srini

  • Text field with AutoComplete do not store Item Value for Cascading LOV

    Hello

    I have created a form to the APEX 4.2, and two elements on the page have a problem. The first point is a text field with AutoComplete for the PROVIDER. The second element is a list select number that has the PROVIDER as part of waterfall to fill.

    When a user selects one of the values that the field can be seized semiautomatic provider , the value autocomplété should make the selection list produce the numbers respective associated PROVIDER. The problem that I am running is that AutoComplete is not give PROVIDER selection list value is filled.

    For example: if I type 'st' in the PROVIDER field that autocompletes to "steve" is selected, the NUMBER field must interrogate him for the numbers where VENDOR = steve. However, after reviewing the Session State from the PROVIDER element, the contained value is always only "st."



    Here are the settings I have for the field PROVIDER : and NUMBER:

    name.JPGnumber.JPG

    There should be a way to have the value of the seized field semi-automatic to account for what appears after selecting a value, but I don't know what it is. You can provide any help would be appreciated.

    Thank you!

    your query full auto would: select supplier_name | ' ('| supplier_id |') '

    provider AutoComplete onChange, get the supplier_id and then value the selected drop-down list by using this code.

  • How do complete you 1 text box with multiple drop-down list values

    I can fill in a text box with a value in a drop-down list, but if I have 2 drop-down list values going to the same area of text (multiple lines), the second drop-down list value removes the first value.

    (A similar code on the drop-down list 1 and 2 from the drop-down list)

    Change event - JavaScript

    If (xfa.event.newText == 'No') {}

    Form1.Page1.subform2.Description.RawValue = "no location listed.

    }

    If (xfa.event.newText == "Partial renting") {}

    Form1.Page1.subform2.Description.RawValue = "enumerated part place."

    }

    Do I have to Concat the fields in 1 text field so that it can have several values in drop-down list, and if so how do I do that?

    Thanks in advance for your help.

    Resolved:

    Place this script in the root of the subform in the FormReady - JavaScript event.

    oList var = this.getDeltas ();

    for (i = 0; i< olist.length;="" i="">

    {

    var oDelta = oList.item (i);

    oDelta.restore ();

    }

    Answer was found at http://forms.stefcameron.com/2008/09/29/restoring-the-of-your-form/

  • Problems with the filling of a text field with 2 other fields data


    I have 3 domains Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.

    Tools_1a_pri is a drop-down list box with a predefined list. One of the options is the 'other '.  If 'Other' is selected, the text Tools_1a_pri_other field becomes visible for users to enter the name of the other tool.

    The Tools_1a_pri_txt is a text field with a calculation that shows a text indicating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.

    When I select one of the predefined tools, everything works.  When I choose the other, it seems that nothing has changed.  Must I click another field before.  It's confusing for the user.

    Tools_1a_pri validate code
    this.getField("Tools_1a_pri_Other").display = event.value is "Other"? Display.visible: display.hidden;

    Computer Tools_1a_pri_txt code
    If nothing is selected, follow these steps
    If (getField("Tools_1a_pri").value.length < 2) {}
    event.target.textColor = color.red
    Event.Value = "no identified main tool";
    } else if (getField("Tools_1a_pri").value! = 'Other') {}
    If not do that if the other is selected
    event.target.textColor = color.black
    Event.Value = getField("Tools_1a_pri").value;
    } else if (getField("Tools_1a_pri").value = 'Other') {}
    If not do so if the other is not selected
    event.target.textColor = color.black
    GetField("Tools_1a_pri").value = Event.Value + "-" + getField("Tools_1a_pri_Other").value;
    }

    You have made the classic mistake of using the assignment operator in a statement instead of the comparison operator. Change this line:
    } else if (getField("Tools_1a_pri").value = 'Other') {}

    To do this:

    } Else if (getField("Tools_1a_pri").value == 'Other') {}

  • Text field with AutoComplete is always NULL

    Greetings,

    I am new to Apex, so I don't know I'm missing something obvious. I use Apex 4.0.1 what I've done is created a form on a page of table and added a new text with page of AutoComplete element. This new field of text does not match a column in the table. What I'm trying to do, is allow the user to use the AutoComplete feature to make a choice. Then when the user submits the page, I want to use the substr function on the value of the field of AutoComplete and fill one of the fields in table. I tried using the PL/SQL functions in validations and calculations, but I found that the autocomplete field value is always NULL. I can access the other fields that are associated with a fine table column. It must be something simple. Thanks for your help.
    Page Items
    P2_F1  - text field with auto complete. Not associated with a table column
    P2_F2 – Text field. Is associate with a table column
    This is what I want to do:
    
    Entered this in a validation
    begin
    if :P2_F1 is not null then
       :P2_F2 := substr(:P2_F1,1,5);
    end if;
    end;
    Thanks again

    Published by: LRM on 22 January 2011 17:25

    Hello

    In calculations, you must use:

    Item name: P2_F2
    Type: SQL Expression
    Point calculation: after submit
    calculation: substr(:P2_F1,1,5)
    Condition type: the value of element in the expression is not null
    Expression 1: P2_F1

    Kind regards

    Patel Kartik
    ---------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • Apex 4.02 BUG: text field with AutoComplete. wrong help text

    The rest of the wizard for a text field with AutoComplete you reach a screen where you can enter an LOV query. The text of the query box has following help text

    Enter the query that returns the list of values. The query must select two columns in the following order, first a display value then a return value. For example:

    Select ename, empno
    WCP


    When you select two identical columns, remember to use the single column alias, for example:

    Select d, r ename ename
    WCP

    However, the query must return only 1 value.

    Thank you, Rene, I fixed in 4.1.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to add an animation to a text field with two lines?

    I have a text field with two or more lines. Why is it not possible now to apply a text animation?àpe_textfield.jpg

    Animating text, by design, only works on a single line of text.

    To use it for multiple lines, you can either create two separate titles or keyframing to create your own animation effect.

  • Have a new 6 but cannot get it to sync with iTunes on my Mac. The two systems have system updates (and both confirm). How can I update iTunes on my phone when he said the latest version?

    Have a new 6s, but cannot get it to sync with iTunes on my Mac. Both systems have system updates (and confirm the latest version). How can I update iTunes on my phone when he said the latest version?

    The message to update iTunes refers to iTunes on your Mac - is your Mac on a high enough version of Mac OS X to support the required iTunes version? If this isn't the case, then your Mac can be changed?

  • Creating a page of my Web site that allows users to fill out text fields, with basic formulation tools (text sizes, formatting, etc.).

    Hey, I would like to create a page on my Web site that allows users to fill out text fields, with basic formulation tools (text sizes, formatting, etc.).

    Another thing I need to allow users must be able to upload their own graphics to the pre-assigned fields. Thank you please advise me on how I would go to this topic.

    Nothing to do with the Muse. You need a system dynamic as Joomla, Wordpress, Drupal and so on. Otherwise, there is no way to store your information.

    Mylenium

  • Ghost of text for a text field with Add Action

    I have a text field with text ghost. Also, there is a button to add additional text fields. When a user clicks on the 'add an additional text field button' new text field appears but without the ghost of the original text field text. I tried the script of the click event of the button to fire or run:

    textfield.execEvent("ready:form"); or textfield.execEvent("form:ready");

    Why 2 ways? LiveCycle has two ways to present it:

    (1) on the drop-down list for events (e.g. form: ready)

    (2) on the name of the field at the top of the script after box selected event on the menu drop-down (for example textfield.ready:form: :-(Javascript, client)

    Is there a better way to do it? My concern is that if I managed to shoot the event form: ready or ready: shape the event can reset all the text from the original text of default ghost of "Kansas City Royals. Thank you

    https://workspaces.Acrobat.com/?d=w3PioRrv8DUp2ruhoOY * 8g

    Put your event form script: ready in the initialize event.

    Kyle

  • Is it Apex_Item function for "text field with AutoComplete?

    Hi all
    Is it Apex_Item function for "text field with AutoComplete? I can't find it in the website http://apex.oracle.com/i/doc/AEAPI/apex_item.htm

    Respect,
    Taylor.

    Hello

    I think that there is not. If there is, it is not documented.

    You can use the normal text field and Add AutoComplete using jQuery UI and jQuery autocomplete plugin.
    Those who are willing to Apex 4

    See for example this post how manually to add autocomplete text field
    Plugin of JQuery autocomplete

    Kind regards
    Jari

Maybe you are looking for

  • How to separate 'bookmark this page' and 'Show bookmarks' in verse. 29.0.1?

    I have since downgraded worms. 29; Does anyone know how to split the icon star Bookmarks window? I preferred to have the bookmark this page in the address bar. I do not know the CTRL + shortcut D; It is more a cosmetic problem that's functionality.

  • Podcast app crashing, madness download

    Today, April 20, 2016, my podcast app in my iphone 6 more is crazy, almost all my podcast comes from AfterbuzzTV, and all keep download and even older month I already listen to (I activated the "delete played episodes"). I used to have "only download

  • OfficeJet pro x551dw: presentation of quality setting

    Hello I would like to print the best quality photos. the menu item 'print settings' and 'quality' submenu item, I see professional option and the presentation of the option. If the option wich would be the best? Thank you in advance for taking the ti

  • I need assistance with the transparent background not made

    I recently bought the BlueFx ultimate lower third Megabuck with Adobe Effects 13.7.2. I am currently changing my current project on Camtasia Version 2 Mac. I also bought the new open 2 with BlueFX and had no problem by adding text, changing colors an

  • Feather edges on the wipes and IRIS. Please?

    Come on! EACH NLE since like 1994 had that. can we please get an option "feather edge" on the Iris and wipes?