Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL and Cursors
Yes it is possible.
Here is an example.
There are two servers SA and SB.
Data has to be moved from SA to SB.
After data has been moved, we need to make sure the tables and rowcounts
are same in both databases.
We can create a table count_check to store table names and rowcounts from these databases.
Assume count_check table is already created.
/*******/
declare..
cursor tab1 is select table_name,num_rows from user_tables;
cursor tab2 is select table_name,num_rows from user_tables_at_db_link;
tab1_rec tab1%ROWTYPE;
tab2_rec tab2%ROWTYPE;
begin
for tab1_rec in tab1
loop
for tab2_rec in tab2
loop
insert into count_table values(tab1_rec.table_name,tab1_rec.num_rows,tab2_rec.table_name, tab2_rec.num_rows);
/********/
Let me know if this helped.
Chinna
Bryan J. Gentile <bgentile_at_bdsinc.com> wrote in article
<340DD969.C2B457F8_at_bdsinc.com>...
> Is it possible with PL/SQL to nest a cursor within another cursor? If
> so, how can I do this, some sample code would be very beneficial.
> Thanks in advance. If possbile, can you email me a response as well as
> replying to this posted message?
>
> --
> **************************************
> Bryan J. Gentile
> Consultant
> Business Data Services, Inc.
> Glastonbury, CT 06033
> Phone: (860) 633-3693 (ext.3006)
> vmail: 6030
> **************************************
>
>
>
Received on Tue Sep 16 1997 - 00:00:00 CDT