285 pts.
 Update in SQL
I have a flat file which I want to update starting from position 2 to 4. I used below UPDATE statement: UPDATE FLAT_FILE SET SUBSTR(FLAT_FILE,2,2)= 'AA' WHERE SUBSTR(FLAT_FILE,1,2) = 'HH' The above SQL Query is throwing an error SQL0104 for missing token. Can anybody suggest me on the above. Thank You.

Software/Hardware used:
ASKED: September 30, 2008  12:01 PM
UPDATED: October 1, 2008  3:17 PM

Answer Wiki:
You can't have a function on the left side of an update, it must be the entire column. Try this: UPDATE FLAT_FILE SET FLAT_FILE = SUBSTR(FLAT_FILE,1,1)|| 'AA'||SUBSTR(FLAT_FILE,4) WHERE SUBSTR(FLAT_FILE,1,2) = 'HH'
Last Wiki Answer Submitted:  October 1, 2008  3:17 pm  by  Dwaltr   900 pts.
All Answer Wiki Contributors:  Dwaltr   900 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _