ORA-01747:Oracle中的user.table.column,table.column或列规范无效

时间:2015-03-01 12:51:22

标签: sql oracle sql-update

具有以下更新查询,该查询提供了我无法识别的错误ORA-01747: invalid user.table.column, table.column, or column specification。我猜有正确的语法,但它仍然给出了错误。这是查询:

Update TEMP_WF_WORKFLOW Set Event_ID=(Select 10003 from TEMP_WF_WORKFLOW TWW JOIN TMP_SOAP_MONITORING_IDS TSM ON TSM.SUBSCRIPTION_ID=TWW.SUBSCRIPTION_ID where TSM.order_type='SELF_REGISTRATION'),
Set Event_ID=(Select 10028 from TEMP_WF_WORKFLOW TWW JOIN TMP_SOAP_MONITORING_IDS TSM ON TSM.SUBSCRIPTION_ID=TWW.SUBSCRIPTION_ID where TSM.order_type='NEW'),    
Set Event_ID=(Select 10078 from TEMP_WF_WORKFLOW TWW JOIN TMP_SOAP_MONITORING_IDS TSM ON TSM.SUBSCRIPTION_ID=TWW.SUBSCRIPTION_ID where TSM.order_type='SELF_REGISTRATION'),
Set Event_ID=(Select 10101 from TEMP_WF_WORKFLOW TWW JOIN TMP_SOAP_MONITORING_IDS TSM ON TSM.SUBSCRIPTION_ID=TWW.SUBSCRIPTION_ID where TSM.order_type='NEW')

1 个答案:

答案 0 :(得分:3)

Update TEMP_WF_WORKFLOW
  Set Event_ID= case (select TSM.order_type
                      from TEMP_WF_WORKFLOW TWW JOIN TMP_SOAP_MONITORING_IDS TSM
                        ON TSM.SUBSCRIPTION_ID=TWW.SUBSCRIPTION_ID)
                  when 'SELF_REGISTRATION' then 10008
                  when 'NEW' then 10003
                  when 'SELF_REGISTRATION' then 10078
                  when 'NEW' then 10101
                  else Event_ID
                end

这就是你要做的!请注意,重复相同的值!!!

为什么要硬编码整数值?