Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 15 Feb 2005 @ 18:22:31 GMT


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


Subj:   Re: Procedure Problem.
 
From:   Muthusamy, Sudha

Ram

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


Thanks

Sudha


     " 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;"


     
  <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: 15 Jun 2023