Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Comparing row count of two tables called by cursor - forum topic by gannu

$
0
0

Hi,
I am trying to compare the row count of table in two different databases but the tables are similar with same DDL. I need to call table name in cursor and database names are parameters of the procedure.  
Replace procedure testProc(a varchar(30),b varchar(30))
BEGIN
-- Cursor is having the names of table in order
OPEN MY_CURSOR ;
WHILE (SQLCODE = 0) DO
FETCH MY_CURSOR INTO T_NAME;
END
 
Now I have to comapre the row count of a.T_name and b.T_name. If they are equal continue and if they are not equal register an error and continue.
 
Can you please help me in this. Any help would be appreciated.
Thanks
 
 

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>