Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quicker way to replace apostrophes from a db 1

Status
Not open for further replies.

Jamfool

IS-IT--Management
Apr 10, 2003
484
GB

At the moment a cursor is used to go thru all the fields in the database with a column datatype varchar/char, and then replace the apostrophes.


Does anyone know a quicker way to replace apostrophes?
 
Code:
update t set c1 = replace(c1,'''',''),c2 = replace(c2,'''','')
 where c1 like '%''%'

(replace is not an ANSI SQL function but many dbms suport it.

Why should you replace apostrophes?
 
Or you don't even have to use cpysplf. You can copy/paste it via CA Operation navigator.
 
Why should you replace apostrophes?

A: We need to remove them because they cause problems when used in a data transfer program, which see them as delimiters
 
I suppose you should change that program :)

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top