If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Seaching for strings using hex constant

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-11, 08:48
JonWaterhouse JonWaterhouse is offline
Registered User
 
Join Date: Oct 2011
Posts: 1
Seaching for strings using hex constant

Hi all,

Some of the char varying columns in my database have single quotations entered as hex 92. I would like to change them to Hex 27 because the COPY command chokes when it hits them in a psql script.

select name
from school
where name like '%' ||cast(x'92' as char) || '%'

does not work to select the rows I need.

Is there a way to do this in the database?

Thanks,

Jon
Reply With Quote
  #2 (permalink)  
Old 11-01-11, 11:41
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
Maybe the replace function?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On