Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    33

    Question Unanswered: Interbase 6 - how do I get the same results as REPLACE in MSSQL with Interbase SQL

    I have a field which stores the location of a tiff file.

    Example \\PCT01\Images\7\368.TIF

    I need to replace all of them with a new path of \\server01\applications\tsteam\data\Images\7\368.T IF

    I can select them


    SELECT FULLFILEPATH FROM NEWTABLE

    HOW DO I SELECT EACH ONE STRIP THE REPLACE THE PART OF THE STRING I DON"T WANT AND REPLACE IT WITH THE ONE I DO WANT.

    I use MS SQL everyday but cursor and replace aren't supported by Interbase so I'm not sure what I can use to replace part of a string and loop through each record and update it.

    Any help would be great

  2. #2
    Join Date
    Mar 2009
    Posts
    24
    better way is to move to Firebird 2.1 which support REPLACE

    REPLACE( <stringtosearch>, <findstring>, <replstring> )
    Replaces all occurrences of <findstring> in <stringtosearch> with <replstring>.

    select replace(x, ' ', ',') from y;

    Firebird 2.1 Release Notes

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Does your version of firebird support the Substr and Pos functions?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Mar 2009
    Posts
    24
    Substring
    How to truncate a string to a certain number of characters?

    Pos : I don't know.

    but there is POSITION

    POSITION See below Returns the start position of the first string inside the second string, relative to the beginning of the outer string. In the second form, an offset position may be supplied so that the function returns a result relative to that position in the outer string.

    POSITION( <string> IN <string> )
    POSITION( <string>, <string> [, <offset-position>] )
    Last edited by VLDG; 03-23-09 at 18:37.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •