免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2331 | 回复: 2
打印 上一主题 下一主题

请教关于PF触发器的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-28 14:19 |只看该作者 |倒序浏览
为了实现当PF中插入一条记录后,系统自动执行某个CL程序。

我先在PF上加了触发器
ADDPFTRG FILE(TESTLIB/TESTPF1) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(TESTLIB/TESTCL) TRG(TESTTRG01)

然后STRSQL用insert命令插入一条记录,记录确实写入了但CL程序未执行

系统报下面错误
Trigger program or external routine detected an error.

按F1显示
                         Additional Message Information                        
                                                                              
Message ID . . . . . . :   SQL0443       Severity . . . . . . . :   30        
Message type . . . . . :   Diagnostic                                         
                                                                              
Message . . . . :   Trigger program or external routine detected an error.   
Cause . . . . . :   Either a trigger program, external procedure, or external
   function detected and returned an error to SQL. If the error occurred in a  
   trigger program, the trigger was on file TESTPF1 in library TESTLIB. If the error
   occurred in an external procedure or function, the external name is TESTPF1 in  
   library TESTLIB.  The associated text is *AFTER *INSERT.  If the error      
   occurred in a trigger program, the associated text is the type of trigger   
   program.  If the error occurred in an external function, the associated text
   is the text of the error message returned from the external function.      
Recovery  . . . :   Refer to the joblog for more information regarding the   
   detected error. Correct the error and try the request again.               


谁能告诉我错在哪里?触发器应该怎么设置?

论坛徽章:
0
2 [报告]
发表于 2010-01-29 14:46 |只看该作者

回复 #1 steve6598 的帖子

就是你那个被触发调用的程序出错了。

触发程序应该带有两个参数。如果触发程序用到其他文件,那些文件应该在*libl里面可以找到。

论坛徽章:
0
3 [报告]
发表于 2010-01-29 15:29 |只看该作者
多谢了。

另外有个问题
网上看到2个参数分别是&BUFFER和&LENG,这2个参数应该是什么类型的?
我现在测试的时候分别是1000位*CHAR和4位*DEC,也通过的。
网上有的RPG例子中&LENG是B类型的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP