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: sqlplus dbms_output

Re: sqlplus dbms_output

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Tue, 19 Sep 2006 19:07:38 GMT
Message-ID: <J5ut51.DvM@igsrsparc2.er.usgs.gov>


soalvajavab1_at_yahoo.com wrote:
> Why I do not see the output of the following procedure in sqlplus??? As
> you see I execute serveroutput on command at beginnig but still it does
> not display the result, Please advise>
>
> set serveroutput on
> set serveroutput on size 200000
> declare
> begin
> for tab in (select table_name from user_tables where table_name =
> '\"BMA_Chemical\"')
> loop
> dbms_output.put_line(' create table
> '||tab.table_name||'(');
> for col in (select column_name,data_type,data_length
> from user_tab_columns where table_name = tab.table_name)
> loop
> dbms_output.put_line(col.column_Name||'
> '||col.data_type||' ('||col.data_length || '),');
> end loop;
> dbms_output.put_line('dummy date)');
> end loop;
> end;
>

Your DBMS_OUTPUT.PUT_LINE commands are inside a loop which is executed based on the result set of your SELECT statement. If you have an empty result set, then the loop body will not be executed, therefore....no output.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Tue Sep 19 2006 - 14:07:38 CDT

Original text of this message

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