本文介绍了更新多个表中的一条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我有一个程序,我从前端传递参数以更新三个表,但不是不更新.

Hi All
I have a procedure where I m passing parameter from front end to update three table but it is not it is not updating.

BEGIN
               UPDATE CNMPNT  SET
               CUSTOMER_ALPHA=@ChangeAlphaPoiner
              WHERE
               CUSTOMER_ALPHA=@aplhaPointer AND
               ltrim(Rtrim(replace(CUSTOMER_ID,char(0),''))) IN (@CustomerIDs)
          (rtrim(replace('0045864',char(0),'')),replace('0046677',char(0),''))'0045864','0046677') (LTRIM(RTRIM(replace('0045864',char(0),''))),LTRIM(RTRIM(replace('0046677',char(0),''))))           (rtrim(replace('0045864',char(0),'')),replace('0046677',char(0),''))          (ltrim(rtrim(replace('0045864',char(0),''))))--,replace('0046677',char(0),'')))
            '%0045864' ='0046677'
               UPDATE CMAPNT  SET
               CUSTOMER_KEY=@ChangeAlphaPoiner
                              WHERE
               CUSTOMER_KEY=@aplhaPointer AND
               ltrim(Rtrim(replace(CUSTOMER_ID,char(0),''))) IN (@CustomerIDs)
            ('0045864','0046677') like '0062076'=@aplhaPointer
               UPDATE CUSMAS  SET
               ALPHA_POINTER=@ChangeAlphaPoiner
               WHERE
               ALPHA_POINTER=@aplhaPointer AND
               ltrim(Rtrim(replace(cust_id,char(0),''))) IN (@CustomerIDs)
               '%0045864%','0046677') ='0062076'
            END




请帮助




Please help

推荐答案

create trigger u_authors on authors for update
as
Insert into log_authors (au_id) select au_id from inserted
go



希望这可以帮助. :rose:

Anurag



Hope this helps. :rose:

Anurag


BEGIN
               UPDATE CNMPNT  SET
               CUSTOMER_ALPHA=@ChangeAlphaPoiner
              WHERE
               CUSTOMER_ALPHA=@aplhaPointer AND
               ltrim(Rtrim(replace(CUSTOMER_ID,char(0),''))) IN (@CustomerIDs)
/*        (rtrim(replace('0045864',char(0),'')),replace('0046677',char(0),''))'0045864','0046677') (LTRIM(RTRIM(replace('0045864',char(0),''))),LTRIM(RTRIM(replace('0046677',char(0),''))))           (rtrim(replace('0045864',char(0),'')),replace('0046677',char(0),''))          (ltrim(rtrim(replace('0045864',char(0),''))))--,replace('0046677',char(0),'')))
            '%0045864' ='0046677'
*/
               UPDATE CMAPNT  SET
               CUSTOMER_KEY=@ChangeAlphaPoiner
                              WHERE
               CUSTOMER_KEY=@aplhaPointer AND
               ltrim(Rtrim(replace(CUSTOMER_ID,char(0),''))) IN (@CustomerIDs)
/*
            ('0045864','0046677') like '0062076'=@aplhaPointer
*/
               UPDATE CUSMAS  SET
               ALPHA_POINTER=@ChangeAlphaPoiner
               WHERE
               ALPHA_POINTER=@aplhaPointer AND
               ltrim(Rtrim(replace(cust_id,char(0),''))) IN (@CustomerIDs)
/*
               '%0045864%','0046677') ='0062076'
*/
            END


这对您有用吗?


Would this work for you?


这篇关于更新多个表中的一条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:38