Q
Problem solve Get help with specific problems with your technologies, process and projects.

Update a substring of a column value

How do I update the substring of a string value? I tried the above in TOAD and I got "ORA-00927: missing equal sign."

How do I update the substring of a string value?

Update table1
Set substr(field_value, 0, 1) = '2'
where id=300

I tried the above in TOAD and I got "ORA-00927: missing equal sign." Please help!

Like this --

update table1
   set field_value = '2' || substr(field_value, 2)
 where id = 300

The SUBSTR expression here takes everything in the string starting at the second character.

This was last published in June 2006

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close