Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 13 Oct 2005 @ 16:29:22 GMT


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


Subj:   Replace Text Function
 
From:   Phil.Oldfield

Is there a way in teradata through SQL or a procedure/function to 'find and replace' text ?

I am trying to convert the following SQL server function

     CREATE FUNCTION .fnTextClean
     (@string_expression1 nvarchar(4000))
     RETURNS nvarchar(4000)

     AS

     BEGIN
           DECLARE @tempstring AS nvarchar(4000)

           SET @tempstring=RTRIM(@string_expression1)
           SET @tempstring=REPLACE (@tempstring, """", "``")
           SET @tempstring=REPLACE(@tempstring,"'","`")
           SET @tempstring=REPLACE(@tempstring,"?","?")
           SET @tempstring=REPLACE(@tempstring,"&","and")
           SET @tempstring=REPLACE(@tempstring,"+","and")
           RETURN @tempstring
     END

Phil Oldfield
Teradata Developer
Iceland Foods Data Warehouse



     
  <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