select in HTML format

Last Wednesday I selected data from an HTML table : select from xml

Today, let’s try the opposite, generate an HTML table from a SQL query


select
XMLSERIALIZE(
DOCUMENT
XMLROOT(
XMLTRANSFORM(
XMLTYPE(
CURSOR(
SELECT * FROM DEPT
)
),
XMLTYPE.CREATEXML(
'




Table DEPT

Table DEPT in HTML format


DEPTNO DNAME LOC




'
)
)
, VERSION '1.0')
)
from DUAL;

Table DEPT in HTML format

DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

Largely inspired from xmlfiles.com

4 thoughts on “select in HTML format

  1. Pingback: Laurent Schneider » Blog Archive » select in HTML format, XQUERY variant

Comments are closed.