Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 05 Nov 2002 @ 22:12:39 GMT


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


Subj:   Re: ExecSQL
 
From:   deWet, Johannes M

Depending on your specific needs, dynamic SQL in a Stored Procedure might help.

Remember, that you are limited to passing and retrieving parameters to the Stored Procedure and can therefore not retrieve multiple rows in an answerset, as you might in a Macro.

I realize the example below is a little 'inappropriate', since the same INSERT SQL could have been executed more effectively, using a Macro, etc... This is only intended to illustrate the point, using a Stored Procedure.

REPLACE PROCEDURE mydb.my_sql(SQL_Text VARCHAR(255))
BEGIN
        CALL DBC.SysExecSQL(:SQL_Text);
END;

CALL  mydb.my_SQL('INSERT INTO mydb.mytable SELECT date;');


     
  <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