Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 18 Mar 2003 @ 14:50:05 GMT


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


Subj:   Re: Alternate way to Cursor
 
From:   Dieter Nöth

In Teradata SQL the only way will be nasty CASEs:

select
  'E;884*750(96' as x,
  (case when substring(x from 1 for 1) in ('E', '0', '1', '2', '3', '4',
'5', '6', '7', '8', '9')
        then substring(x from 1 for 1)
        else ''
   end) ||
  (case when substring(x from 2 for 1) between '0' and '9'
        then substring(x from 2 for 1)
        else ''
   end) ||
  (case when substring(x from 3 for 1) between '0' and '9'
        then substring(x from 3 for 1)
        else ''
   end) ||
  (case when substring(x from 4 for 1) between '0' and '9'
        then substring(x from 4 for 1)
        else ''
   end) ||
  (case when substring(x from 5 for 1) between '0' and '9'
        then substring(x from 5 for 1)
        else ''
   end) ||
  (case when substring(x from 6 for 1) between '0' and '9'
        then substring(x from 6 for 1)
        else ''
   end) ||
  (case when substring(x from 7 for 1) between '0' and '9'
        then substring(x from 7 for 1)
        else ''
   end) ||
  (case when substring(x from 8 for 1) between '0' and '9'
        then substring(x from 8 for 1)
        else ''
   end) ||
  (case when substring(x from 9 for 1) between '0' and '9'
        then substring(x from 9 for 1)
        else ''
   end) ||
  (case when substring(x from 10 for 1) between '0' and '9'
        then substring(x from 10 for 1)
        else ''
   end) ||
  (case when substring(x from 11 for 1) between '0' and '9'
        then substring(x from 11 for 1)
        else ''
   end) ||
  (case when substring(x from 12 for 1) between '0' and '9'
        then substring(x from 12 for 1)
        else ''
   end)
;

Dieter



     
  <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