Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 09 Feb 2012 @ 19:55:46 GMT


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


Subj:   Macro - String Parsing
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, February 09, 2012 11:27 -->

Hi,

I have a requirement that the the following statement in a MACRO .

     SELECT *
     FROM EMPLOYEE
     WHERE NAME IN ( 'NAME_1', 'NAME_2', 'NAME_3' ) ;

However , the input to the macro is in the format 'NAME_1, NAME_2, NAME_3'.

I tried passing the input as '''name_1'', ''name_2'', ''name_3'''

     REPLACE MACRO TEST(NAMES VARCHAR(100))
     AS
     (
       SELECT *
       FROM EMPLOYEE
       WHERE NAME IN ( :NAMES ) ;
     );

     EXEC TEST ( '''name_1'', ''name_2'', ''name_3''' ) ;

Is there any way to do this or am I missing anything ?

Thanks



     
  <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