|
|
Archives of the TeradataForum
Message Posted: Tue, 15 Feb 2005 @ 12:33:44 GMT
Subj: | | Procedure Problem. |
|
From: | | Babu_Gopal |
Hi All,
The below procedure is working and if I take the select statement into variable and then The variable being assigned in the cursor column then
it is not working.
Please throw light on this.
CREATE PROCEDURE abc.LOADSCRIPT(
IN dbname VARCHAR(50),
IN tblname VARCHAR(50),
OUT LoadScript VARCHAR(5000)
)
BEGIN
DECLARE Rcnt INT;
DECLARE STMNT VARCHAR(2500);
BEGIN
SELECT 'SELECT COLUMNNAME,COLUMNTYPE,
COLUMNLENGTH,COLUMNFORMAT ' ||
'FROM DBC.COLUMNS ' ||
'WHERE DATABASENAME = ' '''' || :dbname || ''''
' AND TABLENAME = ' '''' ||:tblname || ''''
INTO :STMNT;
DECLARE DYN_LOADSCRIPT SCROLL CURSOR FOR :STMNT; /* Here is giving problem */
OPEN DYN_LOADSCRIPT;
SET Rcnt = Activity_Count;
CLOSE DYN_LOADSCRIPT;
END;
END;
Thanks & Warm Regards
Ram
| |