DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Enterintg the special Characters into table

  1. #1
    Join Date
    Nov 2000
    Posts
    34
    Hi,
    I wanted to insert the row which contains the value like
    Owner's.

    I am updating the column like the following way
    Update temp set rpt_columns='Project Name, Division,Owner's,District' where rpt_name='1099';

    I am getting the following error in the above statement

    ORA-01756: quoted string not properly terminated.

    Because I am inserting the value Owner's into the table.

    Please help me out how do we enter the special characters like above in the table. I used escape on and tried still its not worked.

    Thanks in advance
    Admala.

  2. #2
    Join Date
    Apr 2000
    Location
    Baltimore, MD
    Posts
    759
    Which escape character did u use, was it \ before ' ??

  3. #3
    Join Date
    Mar 2001
    Posts
    63
    You can either use the escape character (\') or use '' (two single quotes) to insert a string with a single quote.

  4. #4
    Join Date
    Nov 2000
    Posts
    34
    Originally posted by Krutsinger
    You can either use the escape character (\') or use '' (two single quotes) to insert a string with a single quote.

    Here I am writing the query in the following way

    update rem_reports set RPT_COLUMNS='Project Name, Division, District, Program, Purpose, Tract Number,Owner\'s Name, Acreage, Acquired Cost, Estate Code, Remarks,
    Method of Accomplishment'
    where rpt_name='1019'

    RPT_COLUMN is a VARCHAR2(2000) in the table.

    Thank You,
    Praveen.

  5. #5
    Join Date
    Feb 2001
    Posts
    184
    Go Easy ...

    Just Put The 2 Single Quotes within the String if you want a single quote there.

    update rem_reports set RPT_COLUMNS='Project Name, Division, District, Program, Purpose, Tract Number,Owner''s Name, Acreage, Acquired Cost, Estate Code, Remarks,
    Method of Accomplishment'
    where rpt_name='1019' ;

    This will solve your Problem..

    Thanks..


  6. #6
    Join Date
    Nov 2000
    Posts
    344
    In general, anytime you have strange characters you want to insert, you can use the CHR function. For the single quote it is CHR(39).

    If you want to see a listing of what all of the characters are, here is a little trick :

    select rownum, chr(rownum) from dba_objects
    where rownum < 300;


Posting Permissions

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


Click Here to Expand Forum to Full Width