Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 06 Dec 2004 @ 00:44:01 GMT


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


Subj:   Re: Variable Declarations in Queryman
 
From:   Michael Larkins

Allan:

In Teradata you do not do this in the tool. If you did, you would have to do it in every tool. Instead we do it in a macro:

     create macro my_new_macro  (inparm1 char(10), inparm2 dec(10,2)
                                , inparm3 integer) as
     (  select * from table1 where column_name = :inparm1;
        update table2 set column_name where other_column = :inparm2;
        delete from table3 where column_name = :inparm3;
        select * from table2 where other_column = :inparm2; );

The parameters can be any value Teradata recognized data type. They can be used more than once. To execute the macro:

     exec my_new_macro ('parm 1 data', 2234.66, 123456);

The documentation can help you if you need anything more involved. Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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