Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL execution problem (PL/SQL + HTP)

Re: SQL execution problem (PL/SQL + HTP)

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 21 May 2004 11:57:37 -0400
Message-ID: <u_Sdnd99vczfujPdRVn-hQ@comcast.com>

"Sybrand Bakker" <gooiditweg_at_sybrandb.verwijderdit.demon.nl> wrote in message news:uttra0tifb80e05ckkv0jk4v904uifdhgt_at_4ax.com...
| On 19 May 2004 10:21:31 -0500, Galen Boyer <galenboyer_at_hotpop.com>
| wrote:
|
| >What is htp.print, and does this work in sqlplus?
|
| The htp package deals with html styled output
|
|
| You don't need it in sql*plus except for stored procedure output
| Set markup html will make sure all your output is in HTML format
|
|
| --
| Sybrand Bakker, Senior Oracle DBA

refer to the PL/SQL Web Toolkit and PL/SQL Gateway manuals -- the html output that sybrand refers to is specifically for web-based mod_plsql apps that use the PL/SQL Gateway (mod_plsql)

if you are developing web apps, the HTP package is somewhat analogous to the DBMS_OUTPUT package, in that it buffers output -- but the output is specifically intended to be retrieved by the mod_plsql interface and passed back to a browser.

the HTP package has some calls that generate the HTML tags for you (very limited value) , or you can include the HTML tags in strings that you pass to HTP.PRINT or HTP.P

if you are using the HTP package to develop procedures for web apps, you can do some testing of them in SQL*Plus by using the owa_util.showpage procedure after executing them -- OWA_UTIL.SHOWPAGE basically grabs the buffered HTP output and redirects it to DBMS_OUTPUT (although your first HTP call in SQL*Plus will fail:

ie:




SQL> set serveroutput on
SQL> exec htp.p('this will fail')
BEGIN htp.p('this will fail'); END;

*
ERROR at line 1:

ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 323
ORA-06512: at "SYS.HTP", line 860
ORA-06512: at "SYS.HTP", line 975
ORA-06512: at "SYS.HTP", line 993
ORA-06512: at line 1


SQL> exec htp.bold('this htp call spits out this spring with HTML bold tags');

PL/SQL procedure successfully completed.

SQL> exec owa_util.showpage
<B>this htp call spits out this spring with HTML bold tags</B>

PL/SQL procedure successfully completed.

++ mcs Received on Fri May 21 2004 - 10:57:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US