2

I am trying to update a row in a table which has no unique index. So, I selected the ROWID of the row I want to update and now I want to update the row like this:

UPDATE MYTABLE SET MYCOLUMN = 0 WHERE ROWID = "AAAIWWAAFAAApwDADR"

MYCOLUMN is of type NUMBER(1)

I get the error: invalid identifier [SQL State=42000, DB Errorcode=904]

Any idea why?

Vincent Malgrat
  • 66,725
  • 9
  • 119
  • 171
SlappyTheFish
  • 2,344
  • 3
  • 34
  • 41
  • 2
    You could also consider the [`SELECT ... FOR UPDATE`](http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#BABJCEIF) syntax, which implicitly uses `ROWID` so you don't have to deal with it, for a more general case where you aren't hard-coding the value. – Alex Poole Feb 16 '11 at 14:44

2 Answers2

8

Try using single quotes:

UPDATE MYTABLE SET MYCOLUMN = 0 WHERE ROWID = 'AAAIWWAAFAAApwDADR'
Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
0

The easier way is write at the end of your select the cmd for update it allow you to update the row that you desire. Obs: I'm used to do that on Oracle PL/SQL Developer.

Caique Andrade
  • 1,025
  • 7
  • 9