Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 19 Jul 2002 @ 12:02:47 GMT


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


Subj:   Passing In-List of Values to a Macro
 
From:   Claybourne Barrineau

All,

I'm new to playing with macros. Is there a way to pass multiple values to a single parameter? For instance:

Create Macro Test(X Integer)
As (Select * From TableA Where ColumnA in (:X));

I'd like to execute something like this:

Execute Test (1,2);

However, this gives me the error '3817: The position parameter list has too many values.'

If I try:

Execute Test ('1,2')

I get 1 record back where ColumnA = 12. I was expecting 2 records where ColumnA = 1 or ColumnA = 2.

If I redefine my macro as:

Create Macro Test(X Varchar(100))
As (Select * From TableA Where ColumnA in (:X));

Then try to execute the following:

Execute Test ('1,2')

I get 1 record back where ColumnA = 12. Again, not what I was looking for.

Is there an easy way to do what I'm trying to do?


Thanks,

Claybourne Barrineau



     
  <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