Seth Duncan
Seth Duncan

Reputation: 1265

Oracle Column Value Modification

I am trying to fix an issue where some of the items in my table Documents Have a typo in one of the columns

Where it should read Important: Please Read it instead reads ImportantPlease Read

I'm using not to good with Oracle, but how would I essentially do this

Update Documents Set Overview = "Imporantant: Please Read " + 
Overview.SubStr(19, Overview.Length) Where Overview Like 'ImportantPlease Read%'

Now I know this is nowhere near Oracle Syntax but I was wondering if you could help me fill in the gaps

Thanks in advance, and please let me know if you need further explanation.

Upvotes: 2

Views: 95

Answers (2)

Datajam
Datajam

Reputation: 4241

Try this:

UPDATE Documents
SET Overview = REPLACE(Overview, 'ImportantPlease', 'Important: Please')
WHERE Overview LIKE 'ImportantPlease%';

Upvotes: 4

Justin Cave
Justin Cave

Reputation: 231861

You probably want

UPDATE documents
   SET overview = 'Important: Please Read ' || substr( overview, 19 )
 WHERE overview LIKE 'ImportantPlease Read%'

Upvotes: 4

Related Questions