Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Dynamic SQL - Stored Procedure - response (3) by TD_Raj

$
0
0

Hi 
Try something like this:
 

DECLARE T2 CURSOR FOR
SELECT TD_TBL_NM FROM DB_S.TBL_LIST
OPEN T2;

LABEL1 : LOOP

FETCH T2 INTO TABLE_NAME;  /* TABLE_NAME is a variable here */

/* 
DO SOME DML OPERATIONS 
*/

END LOOP LABEL1;

CLOSE T2;

 

--
Raj


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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