Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Using wildcard character

Using wildcard character

Scheduled Pinned Locked Moved Database
database
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 4547220
    wrote on last edited by
    #1

    Hi, I have a following file names in my database. TestDocument _ 1 _ 0 TestDocument _ Evidence Test45 123_publish when i am entering the Test_ in the DocumentName textbox it is forst converted to uppercase and send to the query and query has following expression which returns all record where it should not have to return any record. please tell me the changes in the following expression. I am using the Oracle10g database. UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST_%' Thanks, Umesh Tayade .

    P A 2 Replies Last reply
    0
    • U User 4547220

      Hi, I have a following file names in my database. TestDocument _ 1 _ 0 TestDocument _ Evidence Test45 123_publish when i am entering the Test_ in the DocumentName textbox it is forst converted to uppercase and send to the query and query has following expression which returns all record where it should not have to return any record. please tell me the changes in the following expression. I am using the Oracle10g database. UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST_%' Thanks, Umesh Tayade .

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      OK, I've already answered this in the C# forum, but I'll answer it here as well. As you are aware, the _ is a wildcard character, so it matches any character. If you need to match the _ as a valid character, then you need to escape it with the \ character, which means that your query becomes:

      UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST\_%'

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      1 Reply Last reply
      0
      • U User 4547220

        Hi, I have a following file names in my database. TestDocument _ 1 _ 0 TestDocument _ Evidence Test45 123_publish when i am entering the Test_ in the DocumentName textbox it is forst converted to uppercase and send to the query and query has following expression which returns all record where it should not have to return any record. please tell me the changes in the following expression. I am using the Oracle10g database. UPPER(DOC.ORIGINAL_FILE_NAME) like '%TEST_%' Thanks, Umesh Tayade .

        A Offline
        A Offline
        abcurl
        wrote on last edited by
        #3

        Another alternative is to enclose it using [] Example like '%TEST[_]%' string str = "TEST_" str= str.Replace("_", "[_]");

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups