CREATE OR replace PROCEDURE Hello_world2
IS
BEGIN
HTP.htmlopen;
HTP.headopen;
HTP.Title ('You knew it was coming...');
HTP.headclose;
HTP.comment ('This phrase is in every computer book.');
HTP.Bodyopen (cattributes => 'body bgcolor=blue');
HTP.Print ('And here it is .... Hello, World!');
HTP.bodyclose;
HTP.htmlclose;
END;
How can I output this to an HTML file? I have tried as shown below:
spool report.htm
exec hello_world2;
spool off
exit
But I am getting error as shown below:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 356
ORA-06512: at "SYS.HTP", line 1368
ORA-06512: at "SYS.HTP", line 1443
ORA-06512: at "SYS.HTP", line 1735
ORA-06512: at "SYS.HTP", line 72
ORA-06512: at "T416493.HELLO_WORLD2", line 4
ORA-06512: at line 1
Can anyone help me with this
Normally you would call
owa_util.showpageto spool the contents out.Dan has a nice overview of the usages Oracle OWA_UTIL
There is something funny about this, it should run from sqlplus but I think it expects to be called from mod_plsql, using a web browser.
If you really only want te generate static web pages, you can also use plain old dbms_output to do that. Otherwise, it might be smarter to take a look at Oracle Apex or maybe even a very nice and capable alternative for Oracle Apex, Formspider