Using Like function to search fr results in a database!!

Hi i have created a database for several different clinics in the uk in oracle sql developer. i tried writing the coding for a query but when i run it an error keeps occurring. i want this query to be as a pop up box appears, asks the user to enter the clinic number, and then the user clicks ok, the information for just that selected clinic will be displayed.
my coding is below and so is the error. please help with this error. thank you.
CODING
SELECT Clinics_Table.[ClinicNumber], Clinics_Table.[StreetName], Clinics_Table.[City], Clinics_Table.[County], Clinics_Table.[PostCode], Clinics_Table.[TelephoneNumber], Clinics_Table.[ClinicManager]
FROM Clinics_Table
WHERE (((Clinics_Table.[ClinicNumber]) Like "*" & [Enter Clinic Number] & "*"));
ERROR
Error starting at line 1 in command:
SELECT Clinics_Table.[ClinicNumber], Clinics_Table.[StreetName], Clinics_Table.[City], Clinics_Table.[County], Clinics_Table.[PostCode], Clinics_Table.[TelephoneNumber], Clinics_Table.[ClinicManager]
FROM Clinics_Table
WHERE (((Clinics_Table.[ClinicNumber]) Like "*" 3 Clinic Number] &"*"))
Error at Command Line:1 Column:21
Error report:
SQL Error: ORA-01747: invalid user.table.column, table.column, or column specification
01747. 00000 - "invalid user.table.column, table.column, or column specification"
*Cause:   
*Action:
please reply thank you

Obviously, double quotes are used to delimit Oracle names, so "" & Enter Clinic Number & "" is not interpreted as a literal. Now I assume you were trying to use SQL*Plus substitution variable that has a space in its name. Sorry, quoted name rules do not apply to SQL*Plus substitution variables - they can not have space in them. Anyway, you could do something like:
SELECT  Clinics_Table.ClinicNumber,
        Clinics_Table.StreetName,
        Clinics_Table.City,
        Clinics_Table.County,
        Clinics_Table.PostCode,
        Clinics_Table.TelephoneNumber,
        Clinics_Table.ClinicManager
  FROM  Clinics_Table
  WHERE Clinics_Table.ClinicNumber Like '&Clinic_Number';This will prompt you:
SQL> SELECT  Clinics_Table.ClinicNumber,
  2          Clinics_Table.StreetName,
  3          Clinics_Table.City,
  4          Clinics_Table.County,
  5          Clinics_Table.PostCode,
  6          Clinics_Table.TelephoneNumber,
  7          Clinics_Table.ClinicManager
  8    FROM  Clinics_Table
  9    WHERE Clinics_Table.ClinicNumber Like '&Clinic_Number';
Enter value for clinic_number: For example:
SQL> select ename from emp where empno like '&employee_number';
Enter value for employee_number: 7844
old   1: select ename from emp where empno like '&employee_number'
new   1: select ename from emp where empno like '7844'
ENAME
TURNER
SQL> select ename from emp where empno like '&employee_number';
Enter value for employee_number: 77%
old   1: select ename from emp where empno like '&employee_number'
new   1: select ename from emp where empno like '77%'
ENAME
CLARK
SCOTT
SQL> SY.

Similar Messages

  • Problem using LIKE function

    Hi Guyz,
    I am having small problem using LIKE function . The problem is I am using LIKE function in the WHERE clause
    to compare a column to a particular value, which gets this value from the front end. If the user has a single quote in the string he entered then the LIKE function is not working because of the single quote. Is there any way I can escape the single quote like we escape '%' and '_'.
    Thankyou.

    Mod_plsql supports bind variables, as do almost all front-end tools that deal with Oracle (and most other databases). I do not code mod pl/sql myself, but others here do, and I see bind variables in their code all the time (if I don't, they hear from me :-)).
    If you pass a bind variable, the quote problem goes away. As far as I know (which is not very far), you should be able to take the string with the quote directly from your input field, bind it to the variable in your query and have no problems.
    I suspect that the reson you are having issues is that you are just gluing strings together to create a sql statement. this is the wrong approach.
    The java term for what you are looking for is prepared statement, I'm not sure what the equivalent is i mod plsql, but that should give you a start.
    John

  • How to use LIKE function with a parameter in Oracle REPORT builder??

    how could i use parameter inside a LIKE function in Oracle reports builder?
    it works in SQL plus, but not in report builder!!
    Example:
    select code,desc from item_master where desc
    like '%&give_desc%'; ---works in SQL
    like '%:give_desc%' ---doesn't work in report builder!!

    Hi Renil,
    You will need to use the wildcard character (%) and the concatenation character (||) to join to your user parameter.
    i.e. like '%'||:give_desc||'%'
    Regards,
    John

  • Adding Z field in Opportunity search and result view BT111S_OPPT/Search

    Hi,
    I have been searching this forum on adding Z fields in search and result view but couldnt find the precise information.
    We have Z field in ultimately residing in BUT000.
    Now when this field is used in BP_HEAD_SEARCH for search and result, it could be easily done via configuration. (since the field was added to CRMT_BUPA_IL_HEADER_SEARCH during EEWB extension.
    Now, the requirement is to add the fields in Opportunity BT111S_OPPT/Search & BT111S_OPPT/Result.
    I am confused with regard to the approach we need to use to get this field in search and result.
    I thought the easiest option is to add the Model node and and give the BOL attribute. This works fine but I can't see this field (with dynamic getter/setter) in the UI configuration.
    During the attribute creation wizard, I gave BOL entity as BTQROpp (system defaulted) and the relation was
    BTADVSOpp/BTOrderHeader/BTHeaderPartnerSet/BTPartnerAll/BTBusinessPartner/ZZZGEOG_REGI
    is this correct? or am I doing something wrong?
    Why can't I see the fields in configuration?
    So alternatively I created a field through AET and i could see this field is in the structure and in UI config, but what logic I need to put to retrieve the value?
    Any advice?
    Many thanks in advance for your help
    Rakesh

    Hi Rakesh,
    Please follow below steps:
    1. Append your custom field to structure associated with your search/result structure.
    2. After you append this field to structure, this field would be available in context node.
    3.  Check if the field is reflected in available fields in configuration.
    4. If field is not present in configuration then please follow steps stated by me in:
    Re: New Column can not be added in chtmlb:configTable
    5. Once you add this field to design layer, you would be able to configure it to your search query. Check if your query works with this field.
    If not then please go through below forum :
    Re: BADI for Claims search in trade promotion management
    Let me know if this helps.
    Regards,
    Bhushan

  • Trouble displaying results from a database call

    Hi Everyone,
    I have written a JSP page that sends and receives information to a MySQL database. It is not completely functional unfortunately. The first section of the page that is responsible for updating a database table works fine. However when I go to retrieve information from the same database table something is going astray.
    I feel that I am doing something wrong with regard to the ResultSet object. Please see the bottom of the code section below. Ultimately this code only displays beach_percent as Zero, no matter how many entries there are in the database table for the corresponding value of Beach & Sea Stamps.
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.sql.*" %>
    <%
         Connection connect = null;
         Statement state = null;
         ResultSet rs = null;
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         String password = "theOne";
         String url = "jdbc:mysql://localhost/survey_database";
         String user = "David";
         connect = DriverManager.getConnection(url, user, password);
         state = connect.createStatement();
         if(request.getParameter("radiobutton") != null)
              String enter_text = "insert into craft_survey values('";
              enter_text = enter_text.concat(request.getParameter("radiobutton"));
              enter_text = enter_text.concat("')");
              rs = state.executeQuery(enter_text);
         else
              pageContext.forward("craftSurvey.jsp");
         rs = state.executeQuery("SELECT stamp FROM craft_survey");
         int beach = 0;
         int bear = 0;
         int christmas = 0;
         int country = 0;
         int easter = 0;
         int faux = 0;
         int floral = 0;
         int heart = 0;
         int phrase = 0;
         int special = 0;
         int total = 0;
         while(rs.next())
              String type = rs.getString("stamp");
              if(type.equals("Beach & Sea Stamps"))
                   beach++;
                   total++;
              else
              if(type.equals("Bear & Cuddly Stamps"))
                   bear++;
                   total++;
              else
              if(type.equals("Christmas Stamps"))
                   christmas++;
                   total++;
              else
              if(type.equals("Country & Garden Stamps"))
                   country++;
                   total++;
              else
              if(type.equals("Easter Stamps"))
                   easter++;
                   total++;
              else
              if(type.equals("Faux Postage"))
                   faux++;
                   total++;
              else
              if(type.equals("Floral Stamps"))
                   floral++;
                   total++;
              else
              if(type.equals("Heart & Romance Stamps"))
                   heart++;
                   total++;
              else
              if(type.equals("Phrase & Wording Stamps"))
                   phrase++;
                   total++;
              else
              if(type.equals("Special Occasion Stamps"))
                   special++;
                   total++;
         int beach_percent = 0;
         int bear_percent = 0;
         int christmas_percent = 0;
         int country_percent = 0;
         int easter_percent = 0;
         int faux_percent = 0;
         int floral_percent = 0;
         int heart_percent = 0;
         int phrase_percent = 0;
         int special_percent = 0;
         if(beach > 0)
              beach_percent = (beach / total) * 100;
         if(bear > 0)
              bear_percent = (bear / total) * 100;
         if(christmas > 0)
              christmas_percent = (christmas / total) * 100;
         if(country > 0)
              country_percent = (country / total) * 100;
         if(easter > 0)
              easter_percent = (easter / total) * 100;
         if(faux > 0)
              faux_percent = (faux / total) * 100;
         if(floral > 0)
              floral_percent = (floral / total) * 100;
         if(heart > 0)
              heart_percent = (heart / total) * 100;
         if(phrase > 0)
              phrase_percent = (phrase / total) * 100;
         if(special > 0)
              special_percent = (special / total) * 100;
    %>
    <html>
    <head>
    <title> Craft Stamp Survey Results </title>
    </head>
    <body background="#ffffff">
    <h1> Craft Stamp Survey Results </h1>
    <table width="100%">
         <tr align="center">
         <td><img src="green_bar.jpg" height="20" width="<%=beach_percent *3%>"></td>
            <td>Beach & Sea Stamps</td>
            <td><%=beach_percent%></td>
    </tr>
    </table>
    </body>
    </html>Any help with getting this page to display anything other than zero will be great appreciated.
    Thanks
    David

    Hi,
    One reason could be of spaces .Before checking in the loop use trim function on the data retrieved from the database. You can also debug using System.out.println.
    Also just a suggestion - it is always a good coding practice to declare the variablse outside the loop. Don't declare the variables within a for loop.

  • SDN Search Forum uses Google functionality?

    Hello All,
    I would just like to confirm if the Search forum fuctionality of SCN forums  use google functionality in the background anywhere. As i use the search functionality often in SCN, the administrators in my organization are telling that they receive lots of google search related alerts which is causing some traffic congestion from my system. I just want to confirm if google search is a part of SCN search.
    Regards,
    Vikranth

    Hello Jaishankar,
    Its true that the results vary when you search with the same keywords in google and scn forums. But my question is whether SCN anywhere makes a call to the google search functionality to fetch the results within the SDN website. I am asking this question just to confirm that SCN search is not responsible for the traffic congestion we are facing.
    Regards,
    Vikranth

  • Incorrect result using the function ALSM_EXCEL_TO_INTERNAL_TABLE

    I have used the function ALSM_EXCEL_TO_INTERNAL_TABLE to load a Excel sheet on an internal table and the function returns the following result:
    Row  Col   Value
    0001 0001 902000100 A601 K 627542130 021 AGARDUN ZMAS 673 EU
    0002 0001 902000101 A602 K 627542131 022 AGARDUN ZMAS 695 EU
    0003 0001 902000102 A603 K 627542132 023 AGARDUN ZMAS 717 EU
    0004 0001 902000103 A604 k 627542133 024 AGARDUN ZMAS 739 EU
    0005 0001 902000104 A605 k 627542134 025 AGARDUN ZMAS 761 EU
    0006 0001 902000105 A606 W 627542135 026 AGARDUN ZMAS 783 EU
    0007 0001 902000106 A607 W 627542136 027 AGARDUN ZMAS 805 EU
    0008 0001 902000107 A608 W 627542137 028 AGARDUN ZMAS 827 EU
    0009 0001 902000108 A609 K 627542138 029 AGARDUN ZMAS 849 EU
    0010 0001 902000109 A610 k 627542139 030 AGARDUN ZMAS 871 EU
    0011 0001 902000110 A611 O 627542140 031 AGARDUN ZMAS 893 EU
    That is to say, the excel sheet has nine columns, and the function thinks that only has 1 column.
    I have checked the function with the same file in other computers, and the result has been the correct one, that is to say, the function returns the value of the column in its corresponding column:
    Row  Col   Value
    0001 0001 902000100
    0001 0002 A601
    0001 0003 K
    0001 0004 627542130
    0001 0005 021
    0001 0006 AGARDUN
    0001 0007 ZMAS
    0001 0008 673
    0001 0009 EU
    0002 0001 902000101
    0002 0002 A602
    0002 0003 K
    0002 0004 627542131
    0002 0005 022
    0002 0006 AGARDUN
    0002 0007 ZMAS
    0002 0008 717
    0002 0009 EU
    Can you help me?
    Thanks.

    Hi Garduño,
    1. U want to upload data from EXCEL
    into internal table.
    2. and u are using ALSM_EXCEL_TO_INTERNAL_TABLE.
    3. But We cannot do this direclty !
    For uploading purpose :
    6. There are TWO options.
    a) either save the excel to TAB Delimited file,
    and use GUI_UPLOAD to upload the data in internal table.
    b) use FM for excel purpose.
    7. a) is easy and recommended
    8. b) there is a FM for it,
    but we have to apply some more logic
    bcos the FM uploads data of excel
    in the intenal table,
    CELL BY CELL
    9. afTER THAT , we have to convert this cell by cell data,
    into our format of internal table.
    10. use this code (just copy paste in new program)
    (it is tried wit T001 structure data)
    (it will AUTOMATICALLY based upon the
    fields of internal table,
    convert data from cell by cell,
    to that of internal table fields)
    REPORT abc.
    DATA : ex LIKE TABLE OF alsmex_tabline WITH HEADER LINE.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
    DATA : col TYPE i.
    DATA : col1 TYPE i.
    FIELD-SYMBOLS :  .
    DATA : fldname(50) TYPE c.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = 'd:def.xls'
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 100
    i_end_row = 100
    TABLES
    intern = ex
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    BREAK-POINT.
    CALL FUNCTION 'GET_COMPONENT_LIST'
    EXPORTING
    program = sy-repid
    fieldname = 'T001'
    TABLES
    components = cmp.
    LOOP AT ex.
    AT NEW row.
    IF sy-tabix  = ex-value.
    ENDLOOP.
    BREAK-POINT.
    regards,
    amit m.

  • Why does using Google in the search bar (and only Google) not let me open search results in the same tab?

    Hello,
    When I use Google in the search bar, I have to open the search results in a new tab. If I simply click on them to open in the current tab, I'm inevitably redirected right back to the main Google site. This has only started happening in the past month or two -- I'm considering switching to Chrome after 5 years with Firefox because of this. Please help! It's incredibly frustrating to consistently have to remind myself to open all search results in a new tab. It's quite a waste of time over the course of a day.
    Here are the basic steps:
    1) I do a search using Google in the search bar.
    2) As is supposed to happen, the search returns results in the current tab.
    3) When I click on a result link, I'm immediately sent back to www.google.com.
    4) If I hit back to try to return to the search results, I'm taken to the page that was loaded BEFORE I even did the search.
    5) If, and only if, I instead right-click or Mouse3 click on the search results and open them in a new tab, I can successfully go to the search result pages.
    --Thank you

    Try to clear the Google cookies.
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"

  • When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, and the safe search button is inoperable. Suggestions?

    When using private browsing to view image results in Safari 5.1.3, only the first two rows of results are visible, the following four or so rows display greyed out place holders, the remainder of the results page is blank, and the safe search button is inoperable. When I turn off private browsing and refresh the page, everything works again.
    Anyone else having this problem?

    I have got the same behaviour after the last Safari Update to 5.1.3. It seems that Safari now handles some scripts in a new way. If you debug the Google Website, you will see, that there is some Javascript Error, that seems to prevent to write into local cache. After some searching I wasn't able to finde a solution for this problem, other then disabling Javascript while private browsing to prevent the script loading. You then are able to use Google with the old layout. The option to disable JavaScript can be found in the Menu "Developer", wich has to be enabled in Safari in the options first.
    In my opinion this is a bug that is now occuring, because Apple changed something in private browsing and that has to be fixed by Google now, to run again. Or we will have to wait for 5.1.4, as you can read online Apple will change and bugfix the javascript engine in that version, perhaps this fixes the problem as well. I hope so!
    If anyone is in the developer program perhaps you could test this with the beta of 5.1.4 and tell us if it works.

  • How to use variable in the LIKE function along with % operators

    Hi,
    Is there any way i can use the variable in the Like function. That means i have query like
    SELECT * FROM Device WHERE DeviceName LIKE %v_MediaName%;
    Here "v_MediaName" is the userdefined variable which contains string. I want to retrieve all the records from the "DEVICE" table whose DeviceName LIKE %v_MediaName%;
    If i put it in a single quotes '%v_MediaName%' then the v_MediaName will be treaded as a string instead of a variable. I am using this query in a Procedure.
    please help me out to resolve the issue.
    thanks

    LIKE '%'||v_MediaName||'%';
    Will not make use of the indexes though.
    Message was edited by:
    satishkandi

  • Custom component Search and Result view using value node :pls help

    Hi Experts,
    I am creating a Custom component with Search and Result view using value nodes.
    This is the code I wrote in the Search button event handler method.
    The data which gets in lv_search I need to put in lv_col .
    Can somebody guide me for this.
    Points will be awarded .
    METHOD eh_onsearch.
      DATA : lv_current TYPE REF TO if_bol_bo_property_access,
             lv_search  TYPE zcrm_orgstruct_search,     "Search value node structure
             lv_result  TYPE zcrm_orgstruct_result,         "Result value node structure
             lv_col     TYPE REF TO if_bol_bo_col.
      lv_current ?= me->typed_context->search->collection_wrapper->get_current( ).
      CALL METHOD lv_current->get_properties
        IMPORTING
          es_attributes = lv_search.
      me->typed_context->searchresult->collection_wrapper->set_collection( lv_col ).
      op_toresultview( ).
    ENDMETHOD.
    Regards,
    Lakshmi

    Hi Lakshmi,
    Could you please share with us how it was solved.
    "CALL METHOD lv_current->get_properties
    IMPORTING
    es_attributes = lv_search."
    Did you get any values in lv_search ?
    Because while using value nodes for search view (which inherits from advance search controller  class), the above method does not return any search values entered in the fields.
    Please let me know how did you solve it.
    Thanks & Regards
    Vidhya

  • Hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to

    hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to click on the fn + function key

    Hi,
    You can change this in your system bios as described in the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02035108&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Why CBO don't use function-base index when I use like and bind variable

    Hello
    I have litle problem with function-base index and like with bind variable.
    When I use like with bind variable, the CBO don't use my function-base index.
    For example when I create table and index:
    ALTER SESSION SET NLS_SORT='BINARY_CI';
    ALTER SESSION SET NLS_COMP='LINGUISTIC';
    alter session set nls_language='ENGLISH';
    -- DROP TABLE TEST1;
    CREATE TABLE TEST1 (K1 VARCHAR2(32));
    create index test1_idx on test1(nlssort(K1,'nls_sort=BINARY_CI'));
    INSERT INTO TEST1
    SELECT OBJECT_NAME FROM ALL_OBJECTS;
    COMMIT;
    When I run:
    ALTER SESSION SET NLS_SORT='BINARY_CI';
    ALTER SESSION SET NLS_COMP='LINGUISTIC';
    SELECT * FROM TEST1 WHERE K1 = 'abcd';
    or
    SELECT * FROM TEST1 WHERE K1 LIKE 'abcd%';
    CBO use index.
    PLAN_TABLE_OUTPUT
    SQL_ID 4vrmp7cshbvqy, child number 1
    SELECT * FROM TEST1 WHERE K1 LIKE 'abcd%'
    Plan hash value: 1885706448
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    | 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 2 | 98 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | TEST1_IDX | 2 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("TEST1"."SYS_NC00002$">=HEXTORAW('6162636400') AND
    "TEST1"."SYS_NC00002$"<HEXTORAW('6162636500') )
    but when I run
    SELECT * FROM TEST1 WHERE K1 LIKE :1;
    CBO don't use index
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 0
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 4122059633
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 89 (100)| |
    |* 1 | TABLE ACCESS FULL| TEST1 | 2 | 48 | 89 (3)| 00:00:02 |
    Predicate Information (identified by operation id):
    1 - filter("K1" LIKE :1)
    What should I change to force CBO to use index.
    I don't wont use index hint in query.
    My oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    OK. But why if I create normal index (create index test1_idx on test1(K1)) and return to default nls settings this same query use index.
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 0
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 598212486
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    |* 1 | INDEX RANGE SCAN| TEST1_IDX | 1 | 18 | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - access("K1" LIKE :1)
    filter("K1" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)
    when index is function-base (create index test1_idx on test1(nlssort(K1,'nls_sort=BINARY_CI')))
    PLAN_TABLE_OUTPUT
    SQL_ID 9t461s1669gru, child number 1
    SELECT * FROM TEST1 WHERE K1 LIKE :1
    Plan hash value: 4122059633
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 89 (100)| |
    |* 1 | TABLE ACCESS FULL| TEST1 | 3 | 54 | 89 (3)| 00:00:02 |
    Predicate Information (identified by operation id):
    1 - filter("K1" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)
    when I create index with upper function "index test1_idx on test1(upper(K1))" the query use index
    SELECT * FROM TEST1 WHERE upper(K1) LIKE :1
    Plan hash value: 1885706448
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | | | 1 (100)| |
    | 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 4481 | 157K| 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | TEST1_IDX | 806 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("TEST1"."SYS_NC00002$" LIKE :1)
    filter("TEST1"."SYS_NC00002$" LIKE :1)
    Note
    - dynamic sampling used for this statement (level=2)

  • Incorrect result set with using isnull() function  in IQ 16

    Hi team,
    We have IQ 16 on HP UX.
    When we use isnull() function in where clause we get incorrect result set if we do not use column name in the result set.
    In first select we get result with one row but in second one we get an empty result set.
    select ID, dat_start, dat_end, dat_stop
    from table_test
    where ID=1105935925
    and isnull(dat_stop,dat_start) <> dat_end
    select ID
    from table_test
    where ID=1105935925
    and isnull(dat_stop,dat_start) <> dat_end
    It depends on number of row or volume of data in table, It is possible to use option Revert_To_V15_Optimizer to get the correct result.
    Do you have any different idea how to solve it?
    Thanks Milos.

    We have tested two versions:
    Sybase IQ/16.0.0.653/131122/P/sp03/ITANIUM/HP-UXi 11.31/64bit/2013-11-22 01:49:18
    SAP IQ/16.0.0.807/140507/P/sp08/ITANIUM/HP-UXi 11.31/64bit/2014-05-07 21:11:45
    Both versions have given same mistake.
    We have not opened any support case for this issue because it is data depended issue. It is not easy to simulate it as an example.
    Do you think we should open a support case for it?
    Miloš

  • How to search Database in JSP using LIKE

    hi can anyone tell me is there any other syntax for Query when we use LIKE to search database in which suppose
    String para = request.getParameter("name");
    Select name,surname From user where name LIKE '"+para+"';

    hi,
    which database are you using, some require you to put % sign with like
    e.g. select xyz from table abc where xyz like '%"+para+"%'

Maybe you are looking for

  • Apple Midi loops... where are they located on my computer?

    Hello - I'm wanting to use the Garage Band midi loops in other audio programs. Where can I find them on my computer? I have no problem locating to .aif loops, but the midi loops are very well hidden. Are they even accessible? Any tips, hints? thanks,

  • Infocubes and infoareas

    Dear Experts, Can anyone tell me which table gives information about infocubes and infoareas. ie.. which infocubes belong to which infoarea? Regards, Kris Please search the forum before posting a thread Edited by: Pravender on Sep 27, 2011 10:58 PM

  • CIN settings for import purchases

    Hi friends, could some one write CIN settings to handle import purchases Thanks

  • OER Report error..

    Hi, I am using OER 10.3 and have set up projects and assets as per documentation. When i tried to generated the standard reports like Asset Use, Asset Status etc, i am always getting *null in the report pop-up. When i see the tomcat log, it gives a n

  • Reg :authorization objects

    hai..   This is manny...i would like to congrats for all sdn users.plz let me know about.. what is the exact meaning of authorization object and object classes and authorization fields.i have little bit confusion regarding dis on.i want exact meaning