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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Scripting

Re: Scripting

From: <dean.reynolds_at_home.net>
Date: Fri, 02 Apr 1999 20:23:03 GMT
Message-ID: <37052502.13395321@news>


This is a script that builds a script that reports the number of rows in each table owned by CTA. The reason it looks a little funky is because it's not actually returning data, it's returning SQL statements that, when run, will return data.

I would guess that there is more than one section of the script like this with the variable being

   WHERE owner='???';

otherwise, it would have been more direct to just cut out half the steps and get the data directly.

The || in this script segment just allows some things to be 'hard coded' and others to be generated at runtime.

I guess the goal is to have reports with a consistent appearance over time even if tables are added or dropped from the database.

Does that make sense?

-Dean

On Fri, 02 Apr 1999 08:41:03 -0500, Richard Cuello <rc370_at_columbia.edu> wrote:

>
>SELECT 'SELECT '||''''|| 'The Number of Rows In '||table_name ||
> ' is '||''''|| ' || (COUNT(*)) '||
> 'FROM ' ||table_name||';'
>FROM sys.all_tables
>WHERE owner = 'CTA';
>
Received on Fri Apr 02 1999 - 14:23:03 CST

Original text of this message

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