| |

VerySource

 Forgot password?
 Register
Search
Author: zhy889900

It turned out all right, but since a trigger was added to the SQL database, I got an error and couldn't figure it out ?

[Copy link]

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-8-12 08:15:01
| Show all posts
Check the field parameters used by the trigger. It may be null in the existing or in use
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-8-12 15:30:01
| Show all posts
If I change that field (field related to the trigger) in the SQL Query Analyzer, the execution of the trigger is normal and no error is reported, but it will report an error when running in EJB
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-8-12 16:00:02
| Show all posts
After someone pointed me, my trigger was changed to the following:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

ALTER trigger T_update_trans

on transinfo
for update
as
--Out of service transformer, the outage information table is maintained by the trigger
begin

  if update(booknum)
  begin
  update userinfo set booknum = b.booknum
  from userinfo a,inserted b
  where a.substaid = b.substaid and a.lineid = b.lineid and a.transid = b.transid
  end
end

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

In addition, in the userinfo table changed by this trigger, there is also a trigger, which is also a trigger for the booknum field
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list