Name

XMLType.getClobVal — This function returns the serialization of the current node like XPATH function 'serialize()', i.e. a text in XML syntax.

Synopsis

XMLType.getClobVal ( );

Description

This function returns the serialization of the current node. This is similar to the XPATH function 'serialize()', i.e. a text in XML syntax.

Return Types

The function returns wide string.

Examples

Example24.549.A table with an XMLType column

This populates a table with XML data and then selects string representation of 'ename' element from the appropriate record.

create table TEST_XMLS  (I integer primary key, XMLVAL XMLType);
insert into TEST_XMLS  values (1, XMLType('<emp><empno>221</empno><ename>John</ename></emp>'));
insert into TEST_XMLS  values (2, XMLType('<po><pono>331</pono><poname>PO_1</poname></po>'));
insert into TEST_XMLS  values (3, XMLType('<oil-rig
xml:id="14a_02" water="0.413"/><oil-rig
xml:id="14b_02" water="0.402"/>'));
select e.XMLVAL.extract ('//ename').getCLobVal() as ENAME
  from TEST_XMLS  as e
 where e.XMLVAL.existsNode('/emp/empno')
ENAME
NVARCHAR
_______________________________________________________________________________

<ename>John</ename>

1 Rows. -- 00000 msec.