Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBMS_OUTPUT to HTP.P

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi,

I'm using PLSQL htp.p procedures to generate webpages for some users, and I'm wondring if there's a way to somehow pipe the DBMS_OUTPUT to a variable so I can output it using HTP.P.

I have the same problem with java stored procedures, because if an exception occurs, I can see it in the DBMS_OUTPUT if I run the proc from SQL*PLUS, but not if it's run from a web page using htp.p.

Any ideas? Thanks!!
 
Avoirdupois Man,

If I understand you correctly, you want your exception output to show up on your web page, right? If so, rather than try to output the error via DBMS_OUTPUT, why not trap the exception in your EXCEPTION section and use whatever HTP.P output command that you would otherwise use DBMS_OUTPUT to produce? That way, DBMS_OUTPUT is not even involved and it is purely an HTP.P issue.

Let us know if this idea resolves your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 16:04 (15Oct04) UTC (aka "GMT" and "Zulu"), 09:04 (15Oct04) Mountain Time)
 
Hi,

The problem is that I have java stored procedures that output messages. If i run the java stored procedure in SQLPLUS, the messages will output to the console. However, if I run the procedure from a web browser, nothing will output, because I need to use htp.p() to output anything through the web page. So i need to capture output to the console, and write it using htp.p(). Does this make sense?

Thanks for your help!!
 
How are you generating the message that dbms_output displays? Is there any reason you can't have two lines of code in your exception handler? Something like
Code:
dbms_output.put_line('Oh no!  Exception: '||sqlerrm);
htp.p('Oh no!  Exception: '||sqlerrm);
Yes, you could assign the value to a varchar2 and feed the variable to both calls, but that just adds another line of code and requires another reservation in memory!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top