Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 25 Mar 2008 @ 16:19:48 GMT


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


Subj:   Re: Alias field into table
 
From:   Michael Larkins

Anomy:

If you want to pass a value to SQL it can be in one of the following ways:

1. Named parameters in SQL Assistant

2. A macro

3. A stored procedure


As a macro:

     replace macro month_macro ("in_month" char(10)) as
     (sel :in_month, add_months(date,-1) (format 'mmmm')(char(10)) "month"
     where "month" = :in_month
     ;)

     exec month_macro ('february')

     in_month      month
     february      February

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