Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert text into record that contains single quotes and double quote

bentonJul 24 2009 — edited Jul 24 2009
Hi,

How would I insert the following text into a table. The quotes are throwing errors. Is there anyway to get this in to a table easily? When I use the SQL Developer GUI it is not a problem, but I want to be able to load it in using a script. This is the text;
<p>Weather data are supplied daily to DEC by the Bureau of Meteorology at approximately 11:00 am following a data-quality check. Compartments whose data were last updated prior to today's date are in round brackets for 'Date of last TI update', 'TI', and '24-Hr rain' (these represent instances where weather data were temporarily unavailable). To view overnight rainfall weather station data as posted daily by the Bureau of Meteorology, <a href="http://www.bom.gov.au/climate/dwo/IDCJDW0600.shtml">see BoM's daily weather observations.</a></p>
and this is the results when I try to update the table;
SQL>
SQL> declare
  2  txt varchar2(32762) :='<p>Weather data are supplied daily to DEC by the Bureau of Meteorology at approximately 11:00 am following a data-quality check. Compartments whose data were last updated prior to today's date are in round brackets for 'Da
te of last TI update', 'TI', and '24-Hr rain' (these represent instances where weather data were temporarily unavailable). To view overnight rainfall weather station data as posted daily by the Bureau of Meteorology, <a href="http://www.bom.gov.au/cl
imate/dwo/IDCJDW0600.shtml">see BoM's daily weather observations.</a></p>
  3  ';
  4  begin
  5  update SCT_HTML_CODE
  6  set CODE = txt
  7  where HTM_ID = 7;
  8  end;
  9  /
txt varchar2(32762) :='<p>Weather data are supplied daily to DEC by the Bureau of Meteorology at approximately 11:00 am following a data-quality check. Compartments whose data were last updated prior to today's date are in round brackets for 'Date of
 last TI update', 'TI', and '24-Hr rain' (these represent instances where weather data were temporarily unavailable). To view overnight rainfall weather station data as posted daily by the Bureau of Meteorology, <a href="http://www.bom.gov.au/climate
/dwo/IDCJDW0600.shtml">see BoM's daily weather observations.</a></p>
                                                                                                                                                                                                                 *
ERROR at line 2:
ORA-06550: line 2, column 210:
PLS-00103: Encountered the symbol "S" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_


SQL> COMMIT;

Commit complete.
Thank You
Ben

Edited by: Benton on Jul 24, 2009 2:42 PM
This post has been answered by 21205 on Jul 24 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 21 2009
Added on Jul 24 2009
10 comments
2,267 views