Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / SQL Data Types
 

Save xml data to varchar2 type column

SQL> SQL> create table my_xml_docs   2  ( id     number primary key,   3    xmldoc varchar2(4000)   4  )   5  / Table created. SQL> SQL> insert into my_xml_docs( id, xmldoc )   2  values( 1,   3  '<appointment type="personal">   4      <title>T</title>   5      <start_date>31-MAR-2001</start_date>   6      <start_time>11:00</start_time>   7      <notes>Review</notes>   8      <attendees>   9          <attendee>J</attendee>  10          <attendee>T</attendee>  11      </attendees>  12  </appointment>' )  13  / 1 row created. SQL> SQL> drop table my_xml_docs; Table dropped.