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 -> Displaying a table in DBMS_OUTPUT using OWA package

Displaying a table in DBMS_OUTPUT using OWA package

From: Sameer <dolpheen_at_gmail.com>
Date: Fri, 14 Sep 2007 08:19:26 -0000
Message-ID: <1189757966.679602.127300@g4g2000hsf.googlegroups.com>


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 Received on Fri Sep 14 2007 - 03:19:26 CDT

Original text of this message

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