如何使用此查询更新项目 [英] How to update items using this query

查看:60
本文介绍了如何使用此查询更新项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我插入新项目时它正在工作

但当我更新项目时它不起作用



可以帮助我吗?



如果I_FBP_CHANGED ='C'且I_INITIAL_CUST_LOAD不为空那么

插入ABC

(restortn_step_id,evnt_id ,cust_acc_no,house_no,street_name,cust_name

,MODIFED_TIMESTAMP,MODIFED_BY)



(选择I_STEP_ID作为step_id,

I_EVNT as evnt_id,a.acc_no,a.house_no,a.street_name

,a.cust_name

,sysdate,MODIFIED_BY来自ABC a

其中a.restortn_step_id = I_INITIAL_CUST_LOAD);



i需要使用此查询更新项目如何?

when i am inserting new item its working
but when im updating item its not working

can any one help me?

IF I_FBP_CHANGED = 'C' AND I_INITIAL_CUST_LOAD IS NOT NULL THEN
insert into ABC
(restortn_step_id, evnt_id ,cust_acc_no ,house_no ,street_name ,cust_name
, MODIFED_TIMESTAMP,MODIFED_BY )

(select I_STEP_ID as step_id ,
I_EVNT as evnt_id, a.acc_no,a.house_no, a.street_name
,a.cust_name
, sysdate , MODIFIED_BY from ABC a
where a.restortn_step_id = I_INITIAL_CUST_LOAD);

i need to update item using this query how?

推荐答案

这应该可以解决这个问题...

This should do the trick...
UPDATE ABC
SET restortn_step_id = a.restortn_step_id,evnt_id = a.evnt_id --...
from ABC a
where a.restortn_step_id = I_INITIAL_CUST_LOAD


这篇关于如何使用此查询更新项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆