Archives of the TeradataForum
Message Posted: Tue, 15 Feb 2005 @ 18:22:31 GMT
I would like to know the purpose of your procedure. If your are trying to Generate the dynamic sql by passing dbname,tblname
You can accomplish that using another method
Please let me your need for this procedure so that I can help you
" 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;"
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|