Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 25th, 2004, 10:58 AM
ct976 ct976 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 9 ct976 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
remove ' apostrophe from records SQL??

i'm trying to remove all the ' from a dataset

update A set room = replace (' ' ', '') where room like '% ' %'

but you can't because ' is reserved in oracle to delimit strings and characters..

how would i be able to do this???

Reply With Quote
  #2  
Old October 25th, 2004, 01:06 PM
jiggee jiggee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 27 jiggee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 27 sec
Reputation Power: 0
Thumbs up

Quote:
Originally Posted by ct976
i'm trying to remove all the ' from a dataset

update A set room = replace (' ' ', '') where room like '% ' %'

but you can't because ' is reserved in oracle to delimit strings and characters..

how would i be able to do this???


Assuming that you are trying to update all the rows in a table which contains the " ' " you dont need to specify the where clause. only specify the where clause if you are limit the contents of a table based on a specific criteria. based on the above asumption here is the update statement you need to execute.

update A set room = replace(room, '''','');
(an update without the where clause goes thru the whole table, however you could still specify the where and do the same too.)

if you noticed in the replace function you did not specifiy the string to be replaced in the first place. also you specified 3 apostrophe, you need four . 1st one for opening the string, 2nd one to specify the escape character, 3rd one the apostrophe itself and 4th to close the string.

hth,

Jiggee

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > remove ' apostrophe from records SQL??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT