macros

Database
Enthusiast

macros

hi,
can someone plz pass on the sql to create a macro and the syntax to call the macro from a shell script.

thanks.
1 REPLY
Enthusiast

Re: macros

create macro samplemacro(variable1 int, variable2 char(3))
as
(Update table1 set col1 = col1 * :variable1
where col2 = :variable2;
);

in the shell script
exec samplemacro(2,'ABC')

or
exec samplemacro(variable1=2, variable2='ABC')