This how SQL works - you will have to create a script to do what you want.
If you have 8i, you can do it like this :
scott@8i> create or replace
2 function get_rows( p_tname in varchar2 )
3 return number
4 as
5 l_columnValue number default NULL;
6 begin
7 execute immediate 'select count(*)
8 from ' || p_tname INTO l_columnValue;
9
10 return l_columnValue;
11 end ;
12 /
Function created.
scott@8i>
scott@8i> select table_name, get_rows(table_name)
2 from user_tables
3 /
TABLE_NAME GET_ROWS(TABLE_NAME)
------------------------------ --------------------
BIG_TABLE 3
BLOB_TEST 3
BONUS 0
CHRIS 0
CLOB_DEMO 1
CUSTOMER 0
CUSTOMER_SERVICE 0
DEMO 1
DEPT 4
DUMMY 1
EMP 14
EMPLOYEE 0
EXECUTABLES 4
IMAGE 2
IMAGES 1
IMAGE_TABLE 1
MAPPING_TABLE 8
MYTABLE 0
NEW_EMP 28
ORDERS 0
PRODUCT 0
SALGRADE 5
SPAREPARTCOMB 1
T 3
T1 2
T2 2
TESTLR 0
TEST_IMAGES 1
X 0
29 rows selected.
scott@8i>
As you can imagine -- getting the count(*) will be an expensive
operation and should be used somewhat sparingly.
Courtesy of
Alex