Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 18 Jan 2013 @ 09:44:49 GMT


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


Subj:   Re: Handling IN clause in stored procedure
 
From:   David Clough

What I've done in this situation is to create another Stored Procedure which will split the values out into ROWS.

My SP is called COLS_FROM_STRING :

     CALL COLS_FROM_STRING_P('ABC;XYZ;123',';',ResultCode,ResultMsg);

This Procedure then loops through the string and, for each entry in the list, writes the value to a Temporary Table.

In the invoking SP, first of all I call COLS_FROM_STRING with the IN lists, and then use the generated Temporary Table in place of the IN list.

I won't provide the code for COLS_FROM_STRING, because then it would deprive you (Anonymous) of the pleasure of coding your own !

Good luck.


Regards

David Clough
Senior BI Database Designer



     
  <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