Archives of the TeradataForum
Message Posted: Sun, 06 Dec 2004 @ 00:44:01 GMT
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
|