Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 15 Feb 2005 @ 12:33:44 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


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



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016