Replace part of field

  • I need to replace part of a field. Field contains |3^VA that needs to replaced with |3^. It is a chunk field so there is other information in the field. I am unable to have the replace work correctly. Please help.

  • What's wrong with => replace (fieldname, '|3^VA', '|3^')

  • Getting message that unable to parse query with that - complete script:

    UPDATE PM.Ailment_Info

    SET chunk = replace(chunk, '|3^VA', '|3^')

    WHERE ailment_id = '1

  • Jim Woods (11/21/2011)


    Getting message that unable to parse query with that - complete script:

    UPDATE PM.Ailment_Info

    SET chunk = replace(chunk, '|3^VA', '|3^')

    WHERE ailment_id = '1

    assuming ailment_id is an integer, you have an extra quote in front of the 1

    this parses syntactically:

    UPDATE PM.Ailment_Info

    SET chunk = replace(chunk, '|3^VA', '|3^')

    WHERE ailment_id = 1

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply