johnherman
MIS
I'm having some sort of bind problem with the below. Any help/suggestions welcome!
==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity
Code:
BEGIN;
DECLARE TS CHAR(128);
TN CHAR(128);
CN CHAR(128);
sql_stmt CHAR(500);
DECLARE TCC_CURSOR CURSOR FOR
SELECT TABLE_SCHEMA, TABLE_NM, COLUMN_NM
FROM WRKCIM.TABLE_COLUMN_COUNTS;
OPEN TCC_CURSOR
WHENEVER NOT FOUND
GO TO CLOSE-TCC_CURSOR
FETCH TCC_CURSOR INTO :TS, :TN, :CN;
SET sql_stmt = 'UPDATE WRKCIM.TABLE_COLUMN_COUNTS SET FREQ = '
SET sql_stmt = sql_stmt || '(select count(*) from '||TRIM(TS)||.TRIM(TN)|| ' );'
PREPARE S2 from sql_stmt;
EXECUTE S2;
CLOSE-TCC_CURSOR.
CLOSE TCC_CURSOR;
END;
==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity