Re: SQL - Count of Rows into a table
From: david_g <david_l_gouldNOdaSPAM_at_yahoo.com.invalid>
Date: Fri, 28 Jan 2000 01:57:09 -0800
Message-ID: <000b8d9b.064a40a8_at_usw-ex0106-048.remarq.com>
Date: Fri, 28 Jan 2000 01:57:09 -0800
Message-ID: <000b8d9b.064a40a8_at_usw-ex0106-048.remarq.com>
.. or how about a PL/SQL block:
declare
v_timestamp date :=sysdate;
v_tab1_count Number;
v_tab2_count Number;
v_tab3_count Number;
begin
select count(*)
into v_tab1_count
from tab1;
select count(*)
into v_tab2_count
from tab2;
select count(*)
into v_tab3_count
from tab3;
Insert into tab_count
(tab1,tab2,tab3,timestamp)
Values
(v_tab1_count, v_tab2_count, v_tab3_count, v_timestamp);
end;
/
- Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!