Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 02 Aug 2006 @ 19:14:47 GMT


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


Subj:   Re: Stored Procedure to Create Grant Statements
 
From:   John Graas

The following example illustrates the use of dynamic SQL statements within a stored procedure:

     CREATE PROCEDURE new_sales_table (my_table VARCHAR(30),
     my_database VARCHAR(30))
     BEGIN
     DECLARE sales_columns VARCHAR(128)
          DEFAULT '(item INTEGER, price DECIMAL(8,2) ,
          sold INTEGER)' ;
     CALL DBC.SysExecSQL('CREATE TABLE ' || my_database ||
     '.' || my_table || sales_columns) ;
     END;

jdg

www.jgraas.com



     
  <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