How to query a string containing an apostrophe ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news

    How to query a string containing an apostrophe ?

    Hi there,

    I have a table in an Oracle 9i R2 database containing the following string"

    "It's so easy"

    When I try to execute the following query:
    SELECT EXPRESSION FROM EXPRESSIONS WHERE EXPRESSION = "It's so easy"

    I recieve an error:
    ORA-01740-Missing double quote in identifier

    I tried to correct the query with a double quote:
    SELECT EXPRESSION FROM EXPRESSIONS WHERE EXPRESSION = "It''s so easy"

    then the query return empty.

    Is there something I'm doing wrong ?

    The definition of the table is

    CREATE TABLE EXPRESSIONS
    (
    ID NUMBER(8) NOT NULL,
    EXPRESSION_IDXE D NVARCHAR2(500) NULL,
    CREATEDATE DATE NULL,
    CREATEBY NVARCHAR2(20) NULL,
    )

    Thanks for your help.

    JBF


  • news

    #2
    Re: How to query a string containing an apostrophe ?

    Hi again,

    It was my mistake. I did the query without the uppercase on the first
    letter. I corrected it and it works fine.
    please disregard the previous post.

    JBF.


    "news" <jbfidelia@mult icorpora.cawrot e in message
    news:SGl7b.3603 9$yg2.665188@we ber.videotron.n et...
    Hi there,
    >
    I have a table in an Oracle 9i R2 database containing the following
    string"
    >
    "It's so easy"
    >
    When I try to execute the following query:
    SELECT EXPRESSION FROM EXPRESSIONS WHERE EXPRESSION = "It's so easy"
    >
    I recieve an error:
    ORA-01740-Missing double quote in identifier
    >
    I tried to correct the query with a double quote:
    SELECT EXPRESSION FROM EXPRESSIONS WHERE EXPRESSION = "It''s so easy"
    >
    then the query return empty.
    >
    Is there something I'm doing wrong ?
    >
    The definition of the table is
    >
    CREATE TABLE EXPRESSIONS
    (
    ID NUMBER(8) NOT NULL,
    EXPRESSION_IDXE D NVARCHAR2(500) NULL,
    CREATEDATE DATE NULL,
    CREATEBY NVARCHAR2(20) NULL,
    )
    >
    Thanks for your help.
    >
    JBF
    >
    >

    Comment

    Working...