Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    42

    Unanswered: Is this possible in Oracle??

    I have a column of data that contains double quotes, is it possible to select that row and escape the double quotes at the same time?

    The reason I want to do this is because I need to use the data in a javascript.

    Thanks...

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Exclamation

    Don't know java, but you could do this:


    select replace(col1,'"','\"') from mytable;

    where the '\' is the escape character.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Aug 2003
    Location
    SW Ohio
    Posts
    198

    Re: Is this possible in Oracle??

    I just did ths with a test table.


    SELECT RULE_CONDITION
    FROM TST_TABLE
    WHERE RULE_CONDITION LIKE '%"%';

    RULE_CONDITION
    -----------------------------------------------------------------
    "(A.UNIT_PRICE_CNVT < (A.PRICE_PO - .01) OR
    "A.UNIT_PRICE_CNVT > (A.PRICE_PO + .01)) AND"
    "A.UOM_VCHR <> A.UOM_PO AND"


    What I think your problem is how javascript is interpreting the double quotes.
    In VB/VBA is a function InStr (In String) that should have an equivelant in java. You'll probably have to do a parse for the double quote and then concantenate both ends back together use the CHR/ASC functions to take out/put in the double quotes.

Posting Permissions

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