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.
Dig Deeper on Oracle and SQL
Related Q&A from Rudy Limeback
Read an example of an SQL case expression from our SQL expert Rudy Limeback. Continue Reading
Read SQL expert Rudy Limeback's advice for counting combinations in a table with SQL's GROUP BY clause Continue Reading
Read about the Mimer Validator, a tool used to verify your SQL code, in this tip from SQL expert Rudy Limeback. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.