Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > SQL REPLACE fun...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 6881 of 7037
Post > Topic >>

SQL REPLACE function

by christophercash@[EMAIL PROTECTED] May 7, 2008 at 04:32 AM

Hi Guys,

My database has records with foreign characters at the end of the
string that need to be updated to a '-'.

I have used the following script to identify these records is:

select msib.segment1||'..'
, msib.INVENTORY_ITEM_ID
, organization_id
,ascii(substr(segment1,-1,1)) ascii
from mtl_system_items_b msib
where ascii(substr(segment1,-1,1))
NOT IN (
/*UPPERCASE*/
65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
/*NUMBERS*/48,49,50,51,52,53,54,55,56,57,
/*LOWERCASE*/
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
/*SPECIAL*/95,40,41,39,46,37,44,96,63,42)
ORDER BY MSIB.SEGMENT1

I want to use a script like below which works for the records which
have a ' ' at the end of the field which works fine.

update mtl_system_items_b
set segment1=REPLACE(segment1,' ','-')
where SUBSTR(segment1,-1,1) = ' '

Does anyone know how or if it is possible to use a script like this
which can be used for all of the foreign characters? I guess a I need
a WHERE clause somewhere after the REPLACE where I can specify all the
ascii codes I want to update to '-'?

Any help would be great

Thanks
 




 2 Posts in Topic:
SQL REPLACE function
christophercash@[EMAIL PR  2008-05-07 04:32:50 
Re: SQL REPLACE function
Mark D Powell <Mark.Po  2008-05-07 09:35:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 2:39:59 CDT 2008.