如何将参数或公共变量传递给触发器

sdcgx 2002-10-16 01:39:50
use SALES

IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'InsertPrdStore' AND type = 'TR')
DROP TRIGGER InsertPrdStore
GO

CREATE TRIGGER InsertPrdStore ON [PrdStore] WITH ENCRYPTION
for insert as
begin

insert into PrdTraninfo (PrdrecNo,OutDepNo , OutUserNo,InDepNo,InUserNo,TranType,TranTime)
Select PrdRecNo,0,0,1000,0,81,TranTime from Inserted

go

其中的常数我想用从pb中的公共变量传递过去,应如何实现。谢谢
...全文
46 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
奇遇 2002-10-16
  • 打赏
  • 举报
回复
I can not answer this problem.

Firstly, I think u should not send to the parameters to a trgger.
Secondly, if u want send a different data to trigger by different condition, I think u can also resolove it in trigger.
Lastly, if u really send a parameter to a trigger, my suggest thet u can add column on table PrdStore, then u can send the parameters by column.

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧