简体   繁体   中英

generate dynamic html content in a file using pl/sql - Oracle

I need to generate a HTML file using pl/sql stored procedure. I can do this writing the code statically and then use utl_file , but also i need to show some tables that are generated from a query (here is the dynamic part). I found in google that owa_util can do this using TABLEPRINT function, but i did not found how to store the result in a varchar2 variable, looks like this is not what i need.

Is there any way to do this in oracle? For example:

Input:

select 'Pepe' nombre, 25 edad from dual;

Output:

<table>
<tr>
<td>Nombre</td>
<td>Edad</td>
</tr>

<tr>
<td>Pepe</td>
<td>25</td>
</tr>
</table>

It depends on what application you have access to run these queries. Oracle's SQL Developer has built in HTML export/reporting

you could try using spool and sqlplus.

example: http://www.dba-oracle.com/oracle_tips_html_sql_plus.htm

documentation: http://docs.oracle.com/cd/B12037_01/server.101/b12170/ch8.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM