NEXTVAL用于复合操作中的父/子插入 [英] NEXTVAL for Parent/Child Insert in Composite Operation

查看:62
本文介绍了NEXTVAL用于复合操作中的父/子插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用BizTalk 2009和Oracle,我将X12 834 EDI文档分解为一组关系表,其中包含父表和一组相关的子表。 每个X12事务映射到父表中的单个行。 我想使用Composite操作在单个事务中处理整个文件。 我遇到的问题是父表的PK应该由Oracle SEQUENCE对象生成。 我无法找到一种有效的方法来获取NEXTVAL操作的结果,以便在地图中使用。 团队成员建议我们可以编写一个从脚本functoid调用的.NET组件,以便检索NEXTVAL调用的结果。 虽然功能正常,但这需要我们为进行NEXTVAL呼叫所需的Oracle凭证创建一个单独的存储机制(与SendPort分开)。 我已经看到另一篇文章描述了一个隐藏存储过程背后的机制的实现,但这涉及通过SP发送XML文件,这对于大型EDI文件来说似乎非常不切实际。

因此我的问题...为父表生成PK值的首选方法是什么?参与具有一组子表的复合操作?

解决方案

它真的听起来最好的方法就是使用一个过程来处理逻辑。适配器可以处理非常大的消息大小,虽然我不会将Xml作为参数发送,仅作为整个调用的有效负载,适配器包为您处理。地图中的脚本调用可以工作,但这可以作为过程的一部分更好地封装。

如果你的安全要求需要一个单独的凭证来调用nextval而不是你所谓的程序,你可能需要使用一个发送请求来获取nextval的业务流程,然后采取nextval响应和其他EDI消息数据到地图中以保存它的过程。在使用业务流程时,您可以为映射提供多个输入以组合数据。您只需要为变换形状指定多个输入消息,这将更新两种输入类型的地图。

感谢,

With BizTalk 2009 and Oracle, I'm decomposing an X12 834 EDI document into a set of relational tables, with a Parent table and a set of related Child tables.  Each X12 transaction maps to a single row in the Parent table.  I'd like to use a Composite operation to process the entire file in a single transaction.  The problem I'm having is that the PK of the Parent table should be generated by an Oracle SEQUENCE object.  I cannot figure out an efficient way to get the result of the NEXTVAL operation for use in the map.  A team member has proposed that we could write a .NET component that is called from a Script functoid in order to retrieve the result of the NEXTVAL call.  Although functional, this involves having us create a separate storage mechanism (separate from the SendPort) for the Oracle credentials needed to make the NEXTVAL call.  I've seen another post describing an implementation that would hide this mechanism behind a stored procedure, but that involves sending an XML file via the SP, which seems highly impractical for large EDI files.

Thus my question...what's the preferred method for generating PK values for a Parent table that's to be involved in a Composite operation with a set of Child tables?

解决方案

It really sounds like the best approach would be to use a procedure to handle the logic. The adapter can handle very large message sizes, although I would not send Xml as a parameter, merely as the payload for the whole call, which the adapter pack handles for you. A script call in the map would work but this could be better encapsulated as part of the procedure.

If your security requirements require a separate credential for calling nextval than what you call a procedure with, you would probably need to use an orchestration that sends a request to get the nextval, then take the nextval response and the other EDI message data into a map for the procedure for saving it. You can have more than one input to a map to combine data when using an orchestration. You simply need to specify more than one input message to a transform shape, and this will update your map for both input types.

Thanks,


这篇关于NEXTVAL用于复合操作中的父/子插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆