Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL - Count of Rows into a table
.. 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;
/
![]() |
![]() |