Home Page for the TeradataForum

Archives of the TeradataForum

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

  <Prev Next>  
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)


           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

Phil Oldfield
Teradata Developer
Iceland Foods Data Warehouse

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020