Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Displaying a table in DBMS_OUTPUT using OWA package
Sameer wrote:
> Dear All,
> I have created a procedure to display a table in DBMS_OUTPUT using OWA
> package.
>
>
> PROCEDURE showtable (tablename VARCHAR2)
> AS
> b BOOLEAN;
> OUT CLOB;
> irows INTEGER := 1;
> BEGIN
> OWA.cgi_var_name (1) := 1;
> OWA.init_cgi_env (OWA.cgi_var_name);
> HTP.adddefaulthtmlhdr (FALSE);
> b :=
> OWA_UTIL.tableprint (ctable => tablename,
> cattributes => 'border=1',
> ntable_type => OWA_UTIL.pre_table
> );
>
> WHILE irows > 0
> LOOP
> OUT := OWA.get_line (irows);
>
> IF RTRIM (OUT, CHR (10)) NOT IN ('<PRE>', '</PRE>')
> THEN
> DBMS_OUTPUT.put_line (OUT);
> END IF;
> END LOOP;
> END;
>
> This procedure displays proper tabular output.
> But in few cases it shows tabular output along with <PRE> </PRE> tags.
> Also in few cases it inserts unnecessary carriage returns in the
> output and therefore the rows in output gets misaligned.
>
> Is this the problem with tool that displays output?
> I have tested it with SQL * Plus, Toad, Oracle SQL Developer but it
> displays same output in each case.
>
> Please help me in improving this procedure.
>
> Thanks in advance.
>
> -Sameer
You might also want to look at my TABLEPRINT demo in Morgan's Library at www.psoug.org. It does not do this.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Fri Sep 14 2007 - 10:50:00 CDT