简体   繁体   English

在IBM I中使用存储过程

[英]using stored procedure in IBM I

I have tried for some time but still not able to make a stored procedure on the ibm i. 我已经尝试了一段时间但仍无法在ibm上制作存储过程。 if anyone can write the steps needed. 如果有人可以写出所需的步骤。

I have a cl that contains about 8 Query /400. 我有一个包含大约8个Query / 400的cl。 I can have it run at night but in the event the user wants latest data it would not be. 我可以让它在晚上运行,但如果用户想要最新的数据,它就不会。

I have looked at making a group of views but the queries do breaks and totals and this is not converting well. 我已经考虑过制作一组视图,但查询会中断和总计,但这并不能很好地转换。 i need the exact same data as this bunch of queries makes. 我需要与这一堆查询完全相同的数据。

is the idea that i create an sp and link to the cl? 是我创建sp并链接到cl的想法? or do i code the contents of the cl in the sp? 或者我在sp中编码cl的内容? please if you can give me a step 1. 2. 3 would be best. 如果你可以给我一个步骤,请尽情.2。3将是最好的。

Create a external stored procedure and call your CL program from there. 创建一个外部存储过程并从那里调用您的CL程序。

CREATE PROCEDURE mylib/sqlprocname LANGUAGE CL MODIFIES SQL DATA EXTERNAL NAME mylib/clprogname

Redbooks 红皮书

IT jungle article IT丛林文章

SQL Reference on iSeries iSeries上的SQL参考

I run the convert command to get the sql equivalent. 我运行convert命令来获取sql等价物。 RTVQMQRY. RTVQMQRY。 But when the query is doing breaks and totals on that, and summary level, the data is off. 但是当查询在其上执行中断和总计以及摘要级别时,数据将关闭。 I prefer to get the exact data. 我更喜欢得到确切的数据。

There is a terminology issue here that needs to be addressed. 这里有一个术语问题需要解决。 The 'exact data' - level breaks and totals - that you see with Query/400 is a formatted report; 使用Query / 400查看的“确切数据” - 级别中断和总计是格式化报告; the sort of thing that you would do with program logic in an RPG program. 你在RPG程序中用程序逻辑做的事情。 It is very important that you understand this part: Query/400 is manipulating the raw data. 了解这一部分非常重要:Query / 400正在操纵原始数据。

You can put business logic inside a stored procedure, but you will have to write that code yourself. 您可以将业务逻辑放在存储过程中,但您必须自己编写该代码。 Since you are using Crystal Reports, why don't you put that business logic inside the Crystal Report? 由于您使用的是Crystal Reports,为什么不将该业务逻辑放在Crystal Report中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM