Inserting huge text with single quotes,ampersands...
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Inserting huge text with single quotes,ampersands...

  1. #1
    Join Date
    May 2001
    Location
    Atlanta US
    Posts
    262
    Hi Gurus,

    I need to insert huge chunks of text into database fields.
    These text blocks contain single quotes and ampersands.
    How do I set an escape character for this?

    Thanks!
    Hemant

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    You can mess with escaping single quotes with other single quotes (there can be up to four single quotes in a row and it looks confusing), or you can concatenate chr(39) and chr(38) for the single quote and ampersand (&). How do you get the ascii code for characters? Glad you asked.

    1 declare
    2 v_char varchar2(4);
    3 begin
    4 for i in 32..80 loop
    5 select chr(i) into v_char from dual;
    6 dbms_output.put_line(i||', '||v_char);
    7 end loop;
    8* end;

    SQL> /
    32,
    33, !
    34, "
    35, #
    36, $
    37, %
    38, &
    39, '
    40, (
    41, )
    42, *
    43, +
    44, ,
    45, -
    46, .
    47, /

  3. #3
    Join Date
    May 2001
    Location
    Atlanta US
    Posts
    262
    Thanks Stecal!

    Hey I have one more small problem. In my text I have Bullets.
    These are appearing in the table as question marks '?'.

    Any suggestions?

    Thanks again!
    Hemant

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