To give an example straightaway, below is what I would like to do (without using SQLPlus): In SQLPlus:
SQL> set feed off markup html on
SQL> select * from emp where rownum<=2;
gives this output:
<p>
<table border="1" width="90%" summary="Script output">
<tr>
<th scope="col">
EMPNO
</th>
<th scope="col">
ENAME
</th>
<th scope="col">
JOB
</th>
<th scope="col">
MGR
</th>
<th scope="col">
HIREDATE
</th>
<th scope="col">
SAL
</th>
<th scope="col">
COMM
</th>
<th scope="col">
DEPTNO
</th>
</tr>
<tr>
<td align="right">
7369
</td>
<td>
SMITH
</td>
<td>
CLERK
</td>
<td align="right">
7902
</td>
<td>
17-DEC-80
</td>
<td align="right">
800
</td>
<td align="right">
</td>
<td align="right">
20
</td>
</tr>
<tr>
<td align="right">
7499
</td>
<td>
ALLEN
</td>
<td>
SALESMAN
</td>
<td align="right">
7698
</td>
<td>
20-FEB-81
</td>
<td align="right">
1600
</td>
<td align="right">
300
</td>
<td align="right">
30
</td>
</tr>
</table>
<p>
Is there a straightforward way to do this in SQL only? (using one or more Oracle's XML functions, for example). Any pointers would be most welcome.
EDIT:
To clarify a bit more, I do NOT care for the whitespace or the p / table tags and the attributes of each tags, just the structured html.