Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1

    Unanswered: How to identify unicode characters in record

    If I am having a good day, I can barely spell unicode.
    We are in the process of upgrading our application to support unicode characters.
    CREATE TABLE LOOKUP
    (ID NUMBER,
    DESCRIPTION VARCHAR2(320));
    This table exists in a 10GR2 database that supports UTF-8 character set.

    How do I query the databse to return all the IDs where DESCRIPTION contains 1 or more unicode (non-ASCII) characters?

    I am more than willing to RTFM, if you point me at which FM has the answer.

    Free clues would be much appreciated.

    TIA!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    In short, in your case, if it's not a standard ASCII character, it must be a UTF-8. Standard ASCII characters are single bytes with values between 00 and 7F (hex). Whatever is 80 (hex) or more is a part of a UTF-8 sequence. Now, UTF-8 characters may be 2 to 4 bytes long, but that's not important for your task.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Whatever is 80 (hex) or more is a part of a UTF-8 sequence
    yes, but how is this actually implemented in a WHERE clause?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    this might do the trick

    select asciistr(text), text from <table> where asciistr(text)!= text

    Alan

  5. #5
    Join Date
    Mar 2004
    Location
    Warsaw / Poland
    Posts
    73
    http://download-uk.oracle.com/docs/c...7a.htm#1000047

    select id
    from table
    where description != asciistr(description)

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    THANKS All!
    prior to today I did not know ASCIISTR existed; which makes RTFM a challenge.
    This will make some folks I work with Very Happy today.

    HAND!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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