Searches for a value in a table

Hi guys' no lags,

This should be a simple.

I run an IF statement that needs to check the value of 5 in a pre-completed table.

I find it difficult to find the right method of research in the table.

If (myArray... == "0") {}

do something

}

It's the... bit I'm stuck

indexOf seems to come back just where the value is... but I already know where it is! I just want to know WHAT it is!

There are also values that are exactly the same in other positions in the table. I have to focus more particularly on the value 5.

Any help would be greatly appreciated!

* past out *.

myArray [4] == '0 '.

The elements of an array starts with zero, so the fifth will be 4.

Tags: Adobe Animate

Similar Questions

  • Best way to search for a value in the table

    Hello world

    Need help to decide which application should be used in the following scenario.
    Table  temp_a
    ( col_1 varchar2(20),
     status_flag varchar2(10)
    );
    col_1 is the primary key


    I want to know if a given value is present in "col_1" of the table "temp_a.

    So what query wud be faster:

    1.
     select count (*)
    from temp_a
    where col_1 = v_col_1   -- using variable to check for value
    and status_flag ='active' ;
    2.
     
     select count (*)
    from temp_a
    where col_1 = v_col_1   -- using variable to check for value
    and status_flag ='active' 
    and rownum =1 ;
    Here, I am not concerned about the number (*), I just need to check if the v_col_1 is present or not.

    1. then please let me know, if both are one and the same. or one of them is faster over another.

    2. also, is there a better way to check?

    Thank you
    Abhishek

    The two approaches are the same, because col_1 is a primary key.
    I think that there is a query then faster:

    select count (*)
    from temp_a
    where col_1 = v_col_1
    ;
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Use instr to search for multiple values

    Hello

    My version of Oracle DB is 10.2.0

    I have a file of text separated by delimiters. The text file has 14 columns, and in each column, I have to check the presence of the following
    RV, RV, RV, GV, GV, GV.

    The sample file contains the following

    51151111; 28.18.11; 14711119; 512-GV; 821949,39; 1223,21; 471,49; 821197,29; ABC; 1; 27.18.11; 13


    The following code is for the search for GV
     FUNCTION FUNC_FIND_GV   (p_str IN  VARCHAR2) RETURN NUMBER
       AS
             l_gv_pos NUMBER ;
             begin
             l_gv_pos := INSTR(p_str, 'GV') ;
             RETURN l_gv_pos ;
    
       EXCEPTION
          WHEN OTHERS THEN
           l_gv_pos := 0;
        RETURN l_gv_pos 
       END FUNC_FIND_GV ;
    How can I search for other cases?

    Hello

    You can use regular expresssions to find one a |-at the same time delimited list.
    For example:

    SELECT  REGEXP_INSTR ( p_str
                   , '(RV|RV-|RV/|GV|GV-|GV/)'
                   )          AS match_pos
    FROM     ...
    ;
    

    It is unnecessary to search for one of the 'RV', 'RV' - and ' RV /'; hot for just 'RV' will give the same results. However, it does no harm real, so if you build the list ' RV | RV | RV / | GV | GV | GV /' dynamically, so you don't have to check for duplicates.

    I hope that answers your question.
    If this isn't the case, post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data.

  • Search for multiple values in a single field

    Hello

    I have this request to get results when the user doing a search query:

    select * from (
    select 
    "ID",
    "ID" ID_DISPLAY,
    "SHIFT_DATE",
    "SHIFT",
    "OFFENSE_ID",
    "DESCRIPTION",
    "ANALYST",
    "STATUS",
    "SUBSTATUS"
    from "#OWNER#"."IDSIEM_OFFENSES") 
    where
    OFFENSE_ID IN(:P223_OFFENSES) AND
    
     (
     instr(upper("DESCRIPTION"),upper(nvl(:P223_DESCRIPTION,"DESCRIPTION"))) > 0 
    )
    AND
    (
     instr(upper("SHIFT"),upper(nvl(:P223_SHIFT,"SHIFT"))) > 0 
    )
    AND
    (
     instr(upper("SUBSTATUS"),upper(nvl(:P223_SUBSTATUS,"SUBSTATUS"))) > 0 
    )
    AND
    (
     instr(upper("ANALYST"),upper(nvl(:P223_ANALYST,"ANALYST"))) > 0 
    )
    AND
    (
     instr(upper("SHIFT_DATE"),upper(nvl(:P223_SHIFTDATE,"SHIFT_DATE"))) > 0 
    )
    AND
    (
     instr(upper("STATUS"),upper(nvl(:P223_STATUS,"STATUS"))) > 0 
    )
    
    ORDER BY OFFENSE_ID DESC
    

    The thing I want to do is to set multiple values in the P223_OFFENSES field when I search. For example, an offence is a number, so I want to put in the search box 1111, 3333, 4444, 5555 and the report shows me these 4 offences in the report. The search operation only works when I put only 1 offences, but when I put more than 1, separated by commas, it gives me this error: error report: ORA-01722: invalid number. That is why, because is a number and the character point is not allowed, how can I achieve this? Thank you in advance.

    Best regards, Bernardo

    I solved a problem like this a few times with a utility function of pipeline for extracting the values from the list:

    CREATE or REPLACE TYPE split_tbl AS TABLE OF VARCHAR2 (32767).

    /

    FUNCTION to CREATE or REPLACE split_list

    (

    p_list VARCHAR2

    p_delimiter VARCHAR2: = ', '.

    ) Split_tbl RETURN

    PIPELINED IS

    l_idx PLS_INTEGER;

    l_list VARCHAR2 (32767): = p_list;

    BEGIN

    LOOP

    l_idx: = instr (l_list, p_delimiter);

    IF l_idx > 0

    THEN

    LINE of CONDUCT (substr (l_list, 1, l_idx - 1));

    l_list: = substr (l_list, l_idx + length (p_delimiter));

    ELSIF TRIM (l_list) IS NOT NULL

    THEN

    PIPE ROW (l_list);

    EXIT;

    ON THE OTHER

    EXIT;

    END IF;

    END LOOP;

    RETURN;

    END split_list;

    /

    In this way, you can define SQL like:

    SELECT to_number (column_value) FROM TABLE (split_list (' 1, 3, 99', ','))

    Or for this specific case: replace the condition

    OFFENSE_ID IN(:P223_OFFENSES)

    with

    OFFENSE_ID IN (SELECT to_number (column_value) FROM TABLE (split_list (: P223_OFFENSES, ',')))

    The advantage over using instr or regex is that you can usually always benefit index on OFFENSE_ID

    Better also to restrict entry to only numbers and ', ' or you will always get invalid numbers errors if a user enters "1234, 567, ABC"in the field of P233_OFFENSES.

    Kind regards

    Thierry

  • Address book crashes when searching for any value to AddressBook OSX 10.11.1

    Hi, opening address book without problems. Research or an opening speech crashes the application on the MacMini.

    Action 1 failed: delete cache of the application in the user library, then restart the application.

    Q: should I remove my icloud and restore the account or it is not a serious question?

    CrashLog below:

    ###############

    Process: Contacts [98477]

    Path: /Applications/Contacts.app/Contents/MacOS/Contacts

    ID: com.apple.AddressBook

    Version: 9.0 (1679)

    Generation information: AddressBook_executables-1679000000000000 ~ 6

    Code type: X 86-64 (Native)

    Parent process:? [1]

    Officials: Contacts [98477]

    User ID: 502

    Date/time: 21:22:52.215 2015-11-27 + 0100

    OS version: Mac OS X 10.11.1 (B 15, 42)

    Report Version: 11

    Anonymous UUID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Sleep/wake UUID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Time since started awake: 97000 seconds

    Integrity of system protection: enabled

    Crashed thread: 5 dispatch queue: com.apple.root.default - qos

    Exception type: EXC_CRASH (SIGABRT)

    Exception codes: 0 x 0000000000000000, 0 x 0000000000000000

    Note the exception: EXC_CORPSE_NOTIFY

    Request for clarification:

    Closing the app due to uncaught exception ", reason: '-[ABRecord setValue: forKey ' # #MyFirstNameDisplayedHere # ': 'First'] invalid value ' ending with an exception uncaught called abort() print type

    Specific application Backtrace 1:

    0 CoreFoundation 0x00007fff987dee32 __exceptionPreprocess + 178

    1 libobjc. A.dylib 0x00007fff937484fa objc_exception_throw + 48

    2 CoreFoundation 0x00007fff9884565d + [print raise: format:] + 205

    3 AddressBook 0x00007fffa071c0fd-[ABSuggestedEntriesFetcher personFromContact:] + 128

    Address book 0x00007fffa071bfc4 4 __53-[ABSuggestedEntriesFetcher entriesByUIDForContacts:] + 41 _block_invoke

    5 address book 0x00007fffa06614a8 __44-[NSArray (ABArrayAdditions) _abMapNoFilter:] + 20 _block_invoke

    6 CoreFoundation 0x00007fff9875b41d __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 77 _block_invoke

    7 CoreFoundation 0x00007fff9875b2e9-[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 201

    8 AddressBook 0x00007fffa0646819-[NSArray (ABArrayAdditions) _ab_each:] + 91

    9 AddressBook 0x00007fffa0661484-[NSArray (ABArrayAdditions) _abMapNoFilter:] + 136

    AddressBook 10 0x00007fffa071bf60-[ABSuggestedEntriesFetcher entriesByUIDForContacts:] + 175

    Address book 11 0x00007fffa071bcf3-[ABSuggestedEntriesFetcher fetchEntries] + 43

    Address book 12 0x00007fffa07bb18e-[ABPersonListSearchHelper fetchSuggestedEntriesByUID] + 202

    Address book 13 0x00007fffa07baf40-[ABPersonListSearchHelper performSuggestionSearch:] + 27

    14 ContactsFoundation 0x00007fff9b48286c-[_CNThrottledObservable _sendResultToObserver:withIdentifier:] + 77

    15 ContactsFoundation 0x00007fff9b4840d1 __45-[_CNQueueScheduler afterDelay: performBlock:] + 16 _block_invoke

    16 libdispatch.dylib 0x00007fff8df203c3 _dispatch_client_callout + 8

    17 libdispatch.dylib 0x00007fff8df30674 _dispatch_source_latch_and_call + 2235

    18 libdispatch.dylib 0x00007fff8df24a3b _dispatch_source_invoke + 983

    19 libdispatch.dylib 0x00007fff8df23d0b _dispatch_root_queue_drain + 538

    20 0x00007fff8df23ab8 _dispatch_worker_thread3 + 91 libdispatch.dylib

    21 libsystem_pthread.dylib 0x00007fffa0aa34f2 _pthread_wqthread + 1129

    22 libsystem_pthread.dylib 0x00007fffa0aa1375 start_wqthread + 13

    Binary images:

    0x10584a000 - com.apple.AddressBook (9.0 - 1679) <15886374-2D34-3849-9F68-9B448AC50496>0x1058e3fff /Applications/Contacts.app/Contents/MacOS/Contacts

    0x1085b8000 - 0x1085b9fff com.apple.AddressBook.LocalSourceBundle (9.0 - 1679) <4285734E-D30E-377B-A7EB-D40E0C541F0C>System/Library/Address Book Plug-Ins/LocalSource.sourcebundle/Contents/MacOS/LocalSource

    0x108a8e000 - 0x108a92fff com.apple.DirectoryServicesSource (9.0 - 1679) System/Library/Address Book Plug-Ins/DirectoryServices.sourcebundle/Contents/MacOS/DirectoryServices

    0x108a99000 - 0x108ae7fff com.apple.AddressBook.CardDAVPlugin (10: 9-512) System/Library/Address Book Plug-Ins/CardDAVPlugin.sourcebundle/Contents/MacOS/CardDAVPlugin

    # #MyFirstNameDisplayedHere #.

    If you know that you have a card with this text in the first name field, I suggest that you change or delete. Back up all data before making any changes.

  • Search for the complexity of the table 1 d


    You might be able to take advantage of the variants. Learn more on this subject of LAVA:

    Faster search, secret Stolen table attributes of variant

  • Search for Null values in the result of the query

    I queries a database for modules. I want to display the e-mail address of users, if there is one, if there is an email address, I want to draw the attention of the user of the present and offer them the chance to enter one. I thought I'd use an if statement, but can understand how cod if 'e-mail eq null. If the statement is looking for the text null instead of a null value

    VR;

    or

    --

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com

  • Search for a value in a field in a subform before allowing a user to add a new Instance

    Configuration of the form:

    Name of the page = page 1

    1 subform in Page1 = Info (fixed to slur)

    Objects in the subform Info: name (textfield) and Email (textfield)

    I also have a 2nd subform within Page 1, which contains a button instance add

    What I'm doing:


    1. the user must enter their name and E-mail address, then click 'Add a button to the Instance' to create a new instance of the subform Info : _Info.addInstance (1);

    2. If the user does not enter an e-mail address, I want there to be a message box this info the user address of e-mail is required before, he or she can create a new instance. Note: would be nice if the slider is set to foucs on the email in this particular instance of subform field.

    3. as long as the user tries to add an instance, he or she will be refused if they are not an email in this case

    4. If the user has an e-mail address in this instance, then the script will create adds a new instance

    5. the process should continue in this way for each, each instance button click Add

    I presume that it nees to be a loop and perhaps a scipt for somExpression, but I'm not sure.

    Here's what I have so far (see below)... The script works for the first instance on the page, but this does not prevent instances to be created when the email in the 'current' instance field is empty. I want to prevent the user to add new instances if the email field is balnk in this "current instance. So, I guess I don't know how ot test a field in the current instance in a repeating subform.

    var VNAME = Info.somExpression + ".email";

    var vEmail = xfa.resolveNode (VNAME) .rawValue;

    if (vEmail == null)

    {

    xfa.host.messageBox ("Please enter an email address.");

    }

    else {

    Form._info.addInstance (1);

    var i = Form._Info.count 1;

    xfa.host.setFocus (xfa.resolveNode ("Info [" + i + "].")) Name')); This set is the focus of the cursor in the name field in the newly created subform

    }

    Please advise and thanks in advance!

    Hello

    Try something like;

    var lastRow = Form.resolveNode ("Info [" +(_Info.count-1) + "]"); Get the last row

    If (lastRow.Email.isNull) / / if the email field empty

    {

    xfa.host.messageBox ("Please enter an email address.");

    }

    on the other

    {

    newRow var = _Info.addInstance ();

    xfa.host.setFocus (newRow.Name.somExpression); set the focus to the field name on the line has been added

    }

    Concerning

    Bruce

  • searching for a column value

    Hello

    I need a little faovour... I need search a pariticular table column value... !! Whenever my superiors asking
    What table with that value... This value... etc... !!!

    For this I need a solution... (select query). If I give the value name and the column of the table... I can't what column having this perticular value? is this possible? I have many tables and each table has many columns. It takes a lot of time to search for a value of column for each table and columns. Please give me a nice solution.

    Thanks to the adv.


    Concerning
    Rekha

    for number

    SQL> select table_name, column_name
      2    from (select rownum,table_name, column_name,
      3                 dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =
    &val') x
      4            from user_tab_columns where data_type='NUMBER'
      5  ) where length(x)!=0
      6  /
    Enter value for val: 3000
    old   3:                dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =&val') x
    new   3:                dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =3000') x
    
    TABLE_NAME                     COLUMN_NAME
    ------------------------------ ------------------------------
    EMP                            SAL
    TID                            SAL
    
    7 rows selected.
    
    SQL> 
    

    for varchar2

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> select table_name, column_name
      2    from (select rownum,table_name, column_name,
      3                 dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =
    ''&val''') x
      4            from user_tab_columns where data_type='VARCHAR2'
      5  ) where length(x)!=0
      6  /
    Enter value for val: OPERATIONS
    old   3:                dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =''&val''')
    new   3:                dbms_xmlgen.getxml('select 1 from "'||table_name||'" where "'||column_name||'" =''OPERATIO
    
    TABLE_NAME                     COLUMN_NAME
    ------------------------------ ------------------------------
    DEPT                           DNAME
    
    SQL> 
    
  • We can search for text in a table?

    Hi people,
    I need to search for a text within a table.for ex, I need to find a word "ABEL" in a table.but I n don't know real field names in a table.without using DESC I should look for a string.that is that I should get the names of columns to runtime.for ex,'select * from emp where column_name as
    'ABEL % %';
    Here, this column_name value should be replaced by a select another statement.is it possible? can u suggest me? using oracle 9i.

    Concerning
    VIDS

    If it's just for a table, probably quite simply, I would opt for something like

    SQL> col search_word form a25
    SQL> col column_name form a25
    SQL> col text form a25
    
    SQL> var search_word varchar2(50)
    
    SQL> exec :search_word := 'al'
    PL/SQL procedure successfully completed.
    
    SQL> select  t.column_value.getrootelement() column_name,
            :search_word search_word,
            extractvalue(column_value, '*/text()') text
      from  table(xmlsequence(xmltype (
                                  cursor (select   * from dept)
                               ).extract ('ROWSET/ROW/*'))) t
     where lower(extractvalue(column_value,'*/text()')) like '%' || lower(:search_word) ||'%'
    /
    COLUMN_NAME               SEARCH_WORD               TEXT
    ------------------------- ------------------------- -------------------------
    LOC                       al                        DALLAS
    DNAME                     al                        SALES                    
    
    2 rows selected.
    
  • Reg: Search for nullable columns

    Hi all

    I have a DIAGNOSIS table that has a QDESC as a nullable column.
    DIAGCODE and SDESC columns are not nullable.

    I wrote a stored procedure to retrieve the records from the table of DIAGNOSIS based on the values of columns specified.

    P_ < nom_de_colonne > indicates that the parameter passed to the stored procedure

    Correspong SQL statement goes as follows.

    SELECT * DIAGNOSTIC
    WHERE
    UPPER (DIAGCODE) AS
    (CASE WHEN LENGTH (p_DIAGCODE) > 0 THEN '%' |) Upper (p_DIAGCODE) | '%' ELSE '%' END)

    AND UPPER (SDESC) AS
    (CASE WHEN LENGTH (p_SDESC) > 0 THEN '%' |) Upper (p_SDESC) | '%' ELSE '%' END)

    -QDESC is a nullable field; but the following logic doesn't :-(
    AND UPPER (QDESC) AS
    (CASE WHEN LENGTH (p_QDESC) > 0 THEN '%' |) Upper (p_QDESC) | '%' ELSE '%' END)


    Examples of data in the table is as follows.

    DIAGCODE SDESC QDESC
    --------------- ------------ ------------
    123 / / DESC 1 AAA
    123 / / DESC 2
    123 / / DESC 3 BBB
    123 / / DESC 4


    When I use the query above to search for records with DIAGCODE like 123, I get

    DIAGCODE SDESC QDESC
    --------------- ------------ ------------
    123 / / DESC 1 AAA
    123 / / DESC 3 BBB


    That is to say QDESC with null values are not displayed.

    How am I supposed to change the query to get the correct result?

    Any help would be much appreciated.

    Thank you best regards n,.
    Tanuja

    There are several illusions here.

    First of all: SQL has a logic to three values: TRUE, FALSE and NULL. The result of any operator is TRUE or FALSE and that you can only search for NULL values explicitly using IS NULL.
    Second: You need the dynamic SQL statements: immediate execution or dbms_SQL. Your variable is a column name, not a constant, if you need to build a string that contains the required SQL statement and present the use execute sql immediately or dynamics.
    This will reduce scalability.
    Third: < function name > < some constant > = (column) will ensure that any index on < column > is not used.
    Usually, this will result in catastrophic performance.

    -----
    Sybrand Bakker
    Senior Oracle DBA

  • Search for the nearest value table

    IM wondering if its possible to find a 1 d table worth, if it is not found, then find the nearest match. IM using the 'double' data type and I need at least an accuracy of 4 decimal point in the research.

    For now, im rounding decimal values to the nearest integers from you, but it is not effective at all. Im getting a lot of unwanted split in the plot. I need to be able to search for the decimal points. I found this function "About Equals.VI" starting from a previous thread. Even that uses the concept of the rounding.

    I enclose 3 screws "0.8 & 0.4.VI" are that I created, rounding decimals nearest digit.

    The "approximately equal" is the one I found online.

    The 3rd is I try to mess with what I can find as close a match.

    Y at - it a trick to work around this problem?

    Thank you

    Eureka

    This VI uses the first type of step 3 in your data.  Since you said that you can get the data, you can drop the in VI.

    At the end where I calculate the slope, you can use a linear adjustment if you have full or professional LabVIEW.

  • Advanced search for a price range while searching for an empty values using php in DW

    I'm creating an advanced search with DW php. I want to present a research where some titles can be left black. If looking for empty values (which I did, thank you David Powel), however then research across a range of prices doesn't seem to work.

    Please see attached form:

    The search page:

    <form action="Detailed-Search-Result.php" method="get" target="_self"><table width="90%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td colspan="2"><label for="Detailed Search">Advanced Search</label></td>
        </tr><tr>
        <td><label for="Product">Product:</label>
          </td>
        <td><select name="Category" id="Category">
          <option value=></option>
            <option value="Keyboard">Keyboard</option>
            <option value="Piano">Piano</option>
          </select></td>
      </tr>
      <tr>
        <td><label for="Make">Make:</label>
        </td>
        <td><select name="Manufacturer">
          <option value=></option>
          <option value="Boss">Boss</option>
          <option value="Casio">Casio</option>
          <option value="Kawai">Kawai</option>
          <option value="Ketron">Ketron</option>
          <option value="Korg">Korg</option>
          <option value="Roland">Roland</option>
          <option value="Samson">Samson</option>
          <option value="Yamaha">Yamaha</option>
        </select></td>
      </tr>
      <tr>
        <td><label for="Color">Color:</label></td>
        <td><select name="Color">
          <option value=></option>
          <option value="Black">Black</option>
          <option value="Cherry">Cherry</option>
          <option value="Mahogany">Mahogany</option>
          <option value="Polished Eboney">Polished Eboney</option>
          <option value="Rosewood">Rosewood</option>
          <option value="White">White</option>
          <option value="Red">Red</option>
        </select></td>
      </tr>
    
      <tr>
        <td><label for="Price">Price:</label></td>
        <td><select name="Price">
          <option value=></option>
          <option value="0-500">£0-500</option>
          <option value="500-1000">£500-1000</option>
          <option value="1000-2000">£1000-2000</option>
          <option value="2000">£2000&gt;</option>
        </select></td>
      </tr>
      <tr>
        <td colspan="2">
          <input name="Search2" type="submit" id="Search2"></td>
        </tr>
        </table>
    </form>
    
    

    The results page

    $varCategory_rsgetsearch2 = "%";
    if (isset($_GET['Category'])) {
      $varCategory_rsgetsearch2 = $_GET['Category'];
    }
    $varMake_rsgetsearch2 = "%";
    if (isset($_GET['Manufacturer'])) {
      $varMake_rsgetsearch2 = $_GET['Manufacturer'];
    }
    $varColor_rsgetsearch2 = "%";
    if (isset($_GET['Color'])) {
      $varColor_rsgetsearch2 = $_GET['Color'];
    }
    $varPrice_rsgetsearch2 = "%";
    if (isset($_GET['Price'])) {
      $varPrice_rsgetsearch2 = $_GET['Price'];
    }
    mysql_select_db($database_dBconn, $dBconn);
    $query_rsgetsearch2 = 'SELECT * FROM products';
    $where = false;
    if (isset($_GET['Category']) && !empty($_GET['Category'])) {
     $query_rsgetsearch2 .= ' WHERE Category LIKE varCategory '. GetSQLValueString($_GET['Category'], 'text');
      $where = true;
    }
    if (isset($_GET['Manufacturer']) && !empty($_GET['Manufacturer'])) {
      if ($where) {
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
      }
     $query_rsgetsearch2 .= 'Manufacturer LIKE varManufacturer ' . GetSQLValueString($_GET['Manufacturer'], 'text');
    }
    if (isset($_GET['Color']) && !empty($_GET['Color'])) {
        if ($where) {
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
      }
      $query_rsgetsearch2 .= 'Color LIKE varColor ' . GetSQLValueString($_GET['Color'], 'text');
    }
    if (isset($_GET['Price']) && !empty($_GET['Price'])) {
        if ($where) {
                        } 
       $query_rsgetsearch2 .= ' AND ';
      } else {
       $query_rsgetsearch2 .= ' WHERE ';
        $where = true;
      }
     switch( $_GET['Price'] ){
            case '0-500':
            $query_rsgetsearch2 .= '  RRP BETWEEN 0 AND 500 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
              case '500-1000':
            $query_rsgetsearch2 .= ' RRP BETWEEN 500 AND 1000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
                        case '1000-2000':
            $query_rsgetsearch2 .= ' RRP BETWEEN 1000 AND 2000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break; 
              case '2000':
           $query_rsgetsearch2 .= ' RRP BETWEEN 2000 AND 10000 ORDER BY price ASC'. GetSQLValueString($_GET['Price'], 'text');
            break;
    }
    
    $query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text"));
    $query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
    $rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
    $row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);
    
    

    I would be greatfull for any help

    I managed to solve the problem.

    Ultimately I don't check if the values were empty, as it worked fine without. However, the switch of the price did not work in combination with the rest of the query.

    I solved the problem as follows:

    $varCategory_rsgetsearch2 = "%";
    if (isset($_GET['Category'])) {
      $varCategory_rsgetsearch2 = $_GET['Category'];
    }
    $varMake_rsgetsearch2 = "%";
    if (isset($_GET['Manufacturer'])) {
      $varMake_rsgetsearch2 = $_GET['Manufacturer'];
    }
    $varColor_rsgetsearch2 = "%";
    if (isset($_GET['Color'])) {
      $varColor_rsgetsearch2 = $_GET['Color'];
    }
    $varPrice_rsgetsearch2 = "%";
    if (isset($_GET['Keysound_price'])) {
      $varPrice_rsgetsearch2 = $_GET['price'];
    
    }
    mysql_select_db($database_dBconn, $dBconn);
    $query_rsgetsearch2 = sprintf("SELECT * FROM products WHERE Category LIKE %s AND products.Manufacturer LIKE %s AND products.Color LIKE %s", GetSQLValueString("%" . $varCategory_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varMake_rsgetsearch2 . "%", "text"),GetSQLValueString("%" . $varColor_rsgetsearch2 . "%", "text") );
    switch( $_GET['price'] ){
            case '0-500':
            $query_rsgetsearch2 .= ' AND price BETWEEN 0 AND 500 ORDER BY price ASC';
            break;
              case '500-1000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 500 AND 1000 ORDER BYprice ASC';
            break;
                        case '1000-2000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 1000 AND 2000 ORDER BY price ASC';
            break;
              case '2000':
            $query_rsgetsearch2 .= ' AND price BETWEEN 2000 AND 10000 ORDER BY price ASC';
            break;
    }
    
    $query_limit_rsgetsearch2 = sprintf("%s LIMIT %d, %d", $query_rsgetsearch2, $startRow_rsgetsearch2, $maxRows_rsgetsearch2);
    $rsgetsearch2 = mysql_query($query_limit_rsgetsearch2, $dBconn) or die(mysql_error());
    $row_rsgetsearch2 = mysql_fetch_assoc($rsgetsearch2);
    

    I'm sure you can keep checking the values, however for me the most was not necessary for this.

    Thanks for your help

  • Search for the text value data store

    Hello, I have a PDO of data to store, and I would like to search for a text value in a quantity of measure.  In each of my test series, there is a quantity of measure with the name TCNAME and stores the cell name of test in the string format.  I would like to get all the TCNAMEs that contain "TC4" for example.  Currently, I have to load TCNAME in the portal and display it in an array of string.

    Any ideas how I can do this?

    I assume you are using a PUMA testbed that stores this kind of goods on a unique value chain chains.

    There is no direct search method, so I guess that a script is the only solution we can offer.

    Datafinder you can search for the minimum and maximum of a channel. That would be too much work in the store of ASAM.

    "PDO / cpp"
    protected tcnameMQs: set tcnameMQs = store. GetElementList ("MeasurementQuantity", "name = TCNAME", true)
    protected tcnameMQ: for each tcnameMQ in tcnameMQs
    MsgBox tcnameMq.References ("local_columns"). Elements (1). Properties ("values"). Value
    Next

    ' AOP5 / Corba
    protected tcnameLCs: set tcnameLCs = store. GetElementList ("LocalColumn", "measurement_quantity.name = TCNAME", true)
    protected tcnameLC: for each tcnameLC in tcnameLCs
    MsgBox tcnameLC.Properties ("values"). Value
    Next

    I have added the example which should be the shortest path from my point of view. In AOP5, you can search LocalColumn and spend BA which is less overhead.

    It is perhaps a good idea to post-processing of the data base and crush the decription "Test name" by

    "The test cell name == NAME. You can search not post-processed by Searchin' for.

    protected tcnameMQs: set tcnameMQs = store. GetElementList ("MeasurementQuantity", "description = name of the test cell", true)
    protected tcnameMQ: for each tcnameMQ in tcnameMQs
    tcnameMQ.Properties ("description"). Value = "name of the test cell is" & tcnameMq.References ("local_columns"). Elements (1). Properties ("values"). Value
    Next
    Store.Save

    Thereafter, you would be able to search for it.

    Greetings

    Andreas

  • Assistance needed for the registration of the application and store the values in a table

    Hello

    Hope that this explanation is not confusing. I explained my application you want in the text below and also attached a skeleton VI + screenshot hoping that he will clarify

    I try to do a VI that does the following:
    1. some code (blue Subvi) runs every 200ms
    2. every 200ms, a random number is generated
    3. the random numbers are stored in a table in intervals of time s 0.8 ("iterations")
    4. at any time, the (blue Subvi) code needs to have access to the random numbers generated in 'the previous iteration.

    To clarify, the iterations are as follows:
    Iteration #1: 0 - 1.8 s
    Iteration #2: 2 - 2. 8 s
    Iteration #3: 3 - 3.8 s

    Iteration #4: 4 - 4.8 s
    ..
    And so on...

    So for each iteration: the blue (Subvi) needs to have access to the random numbers generated in the previous iteration, for example:

    Iteration #1 (0 - 1.8 s): The blue (Subvi) Gets an array that contains only the zero (random numbers are recorded for the first time)
    Iteration #2 (2s - 2 8 s): The code gets an array containing random numbers of iteration #1
    Iteration #3 (3 s - s 3.8): the code gets an array containing random numbers of iteration #2
    Iteration #4 (3 s - s 3.8): the code gets an array containing random numbers of iteration #3
    ..
    And so on...

    At any given time in time;
    -The code gets an array that contains all the random, recorded during the previous iteration numbers
    -Values since before her previous iteration are ignored and not stored anywhere

    Thus, for example, to the #7 iteration:

    -The values during the iteration #6 are made available to the code in the form of a table

    -Values of #1 to #5 iterations have been deleted and not stored anywhere

    It is important that all values since before recording the previous iteration are deleted because they are not necessary because VI actaual will work for a long period of storage of numbers a lot more than I have indicated here

    Screenshot of the skeleton VI:

    I tried to play with the paintings, the structures of the case and the registers at offset, but everytime I try I get something wrong

    The skeleton VI is also attached (Iteration_VI and Code_SubVI)

    Any suggestions?

    Thank you!

    Yes, I agree that you need help.  First of all, you really do need to learn more about LabVIEW - spend a few hours with the tutorials, such as those mentioned on the first page of the Forums.  Oops - links to the tutorials which had been present for years seem to have been moved "elsewhere" with August 2016 LabVIEW community reorganization.  But look for them...

    Here are a few screws that basically implement what I described above (with some minor modifications).  First of all, this is a Top level VI which runs at 5 Hz (200 msec waits).  It starts with an array of 5 elements of 0, then once per second, this is replaced by a table of random numbers generated by the Random 5-table sub - VI 5 elements.  Note that I do not use a loop timed - those who are really designed for LabVIEW RT, but use the simplest functions on the Palette of the timer.

    Can't you see how that works?  The array to initialize on the left begins you with a table of 5 elements of 0.  The Timer inside the loop, it runs at 5 Hz, 'Index' counts 1, 2, 3,... to tell you where you are, and 5 shows you everything that lives on the shift register.

    Now sub - VI Random 5-table is supposed to do the following - if she was called to 5, 10, 15,..., it must return a (new) array of 5 random numbers, otherwise, it must return the array that was passed in.  So if all "works", table 5 shows 0, 0, 0, 0, 0 for the first second, a table at random for the second second (which is not superfluous!), a different for the third random picture second and so on.  I have already said a way to build this, but I chose a slightly different method (equivalent).

    Whenever it is called, a new random element is generated and added at the end of a (growing) random table stored in the shift register.  If size become 5, we send this Random-table-of-5 out through Out table and reset the register shift to an empty array.

    The case by default (when the size is not equal to 5) is shown below - we just return the array of entry to and accumulate new random table in full growth.

    These code fragments extracted from VI.  If you have LabVIEW 2016 (see the "2016" at the top right of the image?  This shows that it is a snippet of code LabVIEW 2016), you can open a blank diagram and drag this image, where magic OR converts it to a VI.  Otherwise, the code yourself and try out it.

    Caution - it is designed to run once.  If you run the program of high level, a second time, you may find that the new Random 5 - table appears to 0.4 ", 1.4", 2.4"(instead of 1", 2 ", 3").  I leave as an exercise for understand you to (a) why he is and (b) fix the code.  If you can't do that, then move an another 3-4 hours with the LabVIEW tutorials (or start playing with this code, edit it in some small way and to understand how it works).

    Bob Schor

Maybe you are looking for

  • T43 RAM will go in a T42?

    Anyone know? I want to upgrade my ram to 2 GB, need to know if T42 and T43 using the same memory modules live, or is there a difference please? AHA

  • No response from the HP Photosmart 8453 on Windows 8

    Hello, the developers of HP! I use HP Photosmart 8453 on my PC and it works correctly. But since I installed Windows 8 operating system on my PC as an extra BONE, he couldn't work. There are two operating systems installed on my PC: Win7 Ultimate (64

  • Acer Aspire V15 Nitro Black Edition - Windows 10 drivers (touchpad / IO)

    The touchpad drivers install but do nothing, I saw a post saying install IO drivers, but those who do not install. Choose my laptop, then Windows 10 64-bit model and download the IO drivers, they say "supported system no. None of these drivers seem t

  • Restoration of the factory without recovery disks

    Hello I bought a new laptop Sony Vaio VGN-AR870 in June 2008 and I enjoyed it a bit. It seems to me have succeeded to it bogged down and it works more slowly and more slowly and for a long time and I have remember how it is used to run when I bought

  • New records of nowhere?

    If I can get an explanation on this one, great, if I can get a solution, even better.  I logged on my profile on my parents turn to change a few things in my itunes and the apple update pops up that there is a new version of itunes available, so I go