0 - 3 of 3 tags for dynamic cursors

I'm attempting to develop a stored procedure that takes a table name as a parameter, and performs column-by-column updates to whatever table is passed in.

I have the dynamic SELECT query working correctly:

SET CURSOR_SQL = 'SELECT * FROM ' || P_TABLE_NAME || ' ORDER BY rsid;';
PREPARE CURSOR_STATEMENT FROM CURSOR_SQL;
OPEN CDC_CURSOR;
/* logic */
CLOSE CDC_CURSOR;

Now I'm at the point where I need to fetch the cursor data into local variables...but I can't create table-specific local variables because I don't know what tables will be passed into this procedure.

Hi, I'm new to Teradata but am in the process of converting all of my SQL to run on my new Teradata App db....

I have a SQL snippet loop query that runs on SQL Server but it will not run as is on Teradata. I think I need to do something with cursor but am unsure. Can someone tell me how to convert this statement to run on Teradata? Thanks in advance.

CD1:

UPDATE NFAA_TABLES.NFAA_REGIONCD
SET LoopSpan = 'A'
from NFAA_TABLES.NFAA_REGIONCD nf1
WHERE LoopSpan is null
and exists
(
select *
from NFAA_TABLES.NFAA_REGIONCD nf2
WHERE nf2.LoopSpan = 'A'

i have couple of questions:

how to pass queries in the procedure ( i would be passing different queries at different times)
execute them as cursors
how to find out the no of coulmns in the cursor and fetch them into strings or array( as no of columns in the queries would be changing each for each call)