Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 08 Oct 2001 @ 12:44:55 GMT


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


Subj:   Re: Macros using USING
 
From:   Geoffrey Rommel

  USING A INT, B CHAR(3)
EXPLAIN EXEC Mybetter_macro (:A, :B);
 



Thanks, Michael, but this isn't quite what I was asking. The SQL Reference tells me that I can create a macro with this syntax:

CREATE MACRO macro_name (parameters...) AS ( USING modifier statement; );

... but it gives no examples with a USING clause in that position. As shown below, I tried to create a macro from BTEQ using this syntax, but it didn't seem to work. Is such a thing really possible (or necessary)?

create macro lcidba.ins_sp_used
  ( in_dt       date,
    in_tm       time(0),
    in_used_qt  decimal(15,0) )
as (
using ( in_dt, in_tm, in_used_qt )
insert into lcidba.spool_used
   ( when_dt
    ,when_tm
    ,spool_used_qt )
   VALUES ( ?, ?, ? );
);

using ( in_dt, in_tm, in_used_qt )
              $
 *** Failure 3706 Syntax error: expected something between the word 'in_dt' and ','.
                Statement# 1, Info =132
 *** Total elapsed time was 1 second.


     
  <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: 27 Dec 2016