SQL Error: ORA-00933: SQL command not properly ended

后端 未结 5 2144
鱼传尺愫
鱼传尺愫 2020-11-29 09:03

I am trying to update a record in oracle SQL developer by using Joins. Following is my query-

UPDATE system_info set field_value = \'NewValue\' 
FROM system_         


        
5条回答
  •  一向
    一向 (楼主)
    2020-11-29 09:48

    Oracle does not allow joining tables in an UPDATE statement. You need to rewrite your statement with a co-related sub-select

    Something like this:

    UPDATE system_info
    SET field_value = 'NewValue' 
    WHERE field_desc IN (SELECT role_type 
                         FROM system_users 
                         WHERE user_name = 'uname')
    

    For a complete description on the (valid) syntax of the UPDATE statement, please read the manual:

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10008.htm#i2067715

提交回复
热议问题