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

Home -> Community -> Usenet -> c.d.o.server -> Re: Displaying a table in DBMS_OUTPUT using OWA package

Re: Displaying a table in DBMS_OUTPUT using OWA package

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 14 Sep 2007 08:45:28 -0700
Message-ID: <1189784720.223698@bubbleator.drizzle.com>


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

Does it on my system in 11.1.0.6 too. Can't answer the question as to why. I would suggest opening an SR at metalink but this code is so old I wouldn't expect fixing it to be a high priority.

You might try spooling it to a file and seeing what character is actually embedded.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Sep 14 2007 - 10:45:28 CDT

Original text of this message

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