![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 25 Mar 2008 @ 16:19:48 GMT
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
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||