Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Brussel
    Posts
    52

    Unanswered: Query/Settings problem

    I have a query in SQL*PLUS:

    select *
    from glossary_item
    where expression = 'Attachment';

    That returns 5 rows. When I do:

    select *
    from glossary_item
    where expression = '%Attach%';

    It returns 0 rows!!! Is that possible? If you put a '%'-sign, he must search all words with 'Attach' in it, like 'Attachment' for example. Right?

    Is it possible that in the settings there is an other character setted for the % thing I want? How can I change that?
    A good programmer is a LAZY programmer!

  2. #2
    Join Date
    Oct 2003
    Posts
    87
    where expression like '%Attach%';
    Oracle - DB2 - MS Access -

  3. #3
    Join Date
    Sep 2003
    Location
    Brussel
    Posts
    52
    That works. Thanks. But why not '='??? Thought that = and LIKE were the same.
    A good programmer is a LAZY programmer!

  4. #4
    Join Date
    Oct 2003
    Location
    St.Louis,MO
    Posts
    120
    Originally posted by Lazy
    That works. Thanks. But why not '='??? Thought that = and LIKE were the same.
    '=' looks for an exact match of the quoted item
    like searches for the string within %
    when you do ='%anything%' Oracle looks for the exact value of %anything%

  5. #5
    Join Date
    Oct 2003
    Posts
    2

    query problem

    Topic:
    where expression like '%Attach%';

    Response:
    when using the wildcard(%) character, you must use "LIKE" instead of "=".

    the query you have now is telling Oracle to find the text "%Attach%", therefore Oracle does not know you are using the wildcard.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •