Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 31 Aug 2001 @ 20:23:44 GMT


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


Subj:   Like comparison in macro
 
From:   Anomy Anom

<-- Anonymously Posted: Friday, August 31, 2001 16:06 ->

I have a macro with a LIKE comparison but it is not returning any rows. Executing the select SQL not using a macro returns the correct data. Does LIKE work using macros?

exec a_k11111 ('911 CUTOVER','','ZZZZZZ','19990101','20011230','%','%')

REPLACE MACRO A_K11111
 (
  OPENED_BY         ( CHAR(25) )
 ,ERROR_NUMBER_LOW  ( CHAR(6) )
 ,ERROR_NUMBER_HIGH ( CHAR(6) )
 ,OPENED_DT_LOW     ( CHAR(8) )
 ,OPENED_DT_HIGH    ( CHAR(8) )
 ,DESCRIPTION       ( CHAR(80) )
 ,ERROR_DATA        ( VARCHAR(255) )
 )
 AS
 (
    SELECT ERROR_NUMBER
          ,DESCRIPTION
          ,ERROR_DATA
          ,OPENED_BY
          ,OPENED_DT
          ,OPENED_TM
          ,LATEST_MOD_DT
          ,LATEST_MOD_TM
          ,REMARKS
    FROM   SMERROR
    WHERE  (
            OPENED_BY    = :OPENED_BY
            AND
            ERROR_NUMBER GE :ERROR_NUMBER_LOW
            AND
            ERROR_NUMBER LE :ERROR_NUMBER_HIGH
            AND
            OPENED_DT    GE :OPENED_DT_LOW
            AND
            OPENED_DT    LE :OPENED_DT_HIGH
            AND
            DESCRIPTION  LIKE :DESCRIPTION
            AND
            ERROR_DATA   LIKE :ERROR_DATA
           )
    ORDER BY OPENED_DT, OPENED_TM;
 );


     
  <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