开发者

PL/SQL: Update row based on ROWID

开发者 https://www.devze.com 2023-02-11 23:09 出处:网络
I am trying to update a row in a table which has n开发者_运维百科o unique index.So, I selected the ROWID of the row I want to update and now I want to update the row like this:

I am trying to update a row in a table which has n开发者_运维百科o 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?


Try using single quotes:

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消