简体   繁体   English

直接在iSeries上的SQL DB2日记条目

[英]SQL DB2 journal entries directly on iSeries

A while ago I came across an SQL statement that can be used on the iSeries/DB2 to extract data directly from database journals. 不久前,我遇到了一个SQL语句,该语句可在iSeries / DB2上使用,以直接从数据库日志中提取数据。 It worked without having to use DSPJRN etc. It invoked a stored procedure and the results came directly back to the SQL session. 它可以工作而不必使用DSPJRN等。它调用了存储过程,结果直接返回到SQL会话。 Unfortunately I have since lost the info. 不幸的是,此后我丢失了信息。

Does anyone know the stored procedure name and how to write the SQL statement? 有谁知道存储过程的名称以及如何编写SQL语句?

Found it. 找到了。 It works via a UDTF - user defined table function - provided by IBM. 它通过IBM提供的UDTF(用户定义的表函数)工作。

The format is as follows. 格式如下。 Only the first 2 parameters are required. 仅需要前两个参数。 There is a decent blog about it here: http://ibmsystemsmag.blogs.com/i_can/2010/11/ 这里有一个不错的博客: http : //ibmsystemsmag.blogs.com/i_can/2010/11/

select * from table (Display_Journal( 'journLib', 'Journal', -- Journal library and name -- 'receiverLib', 'Receiver', -- Receiver library and name -- CAST(null as TIMESTAMP), -- Starting timestamp -- CAST(null as DECIMAL(21,0)), -- Starting sequence number -- '', -- Journal codes -- '', -- Journal entries -- '','', -- Object library, Object name -- '','', -- Object type, Object member -- '', -- User -- '', -- Job -- '' -- Program -- 从表中选择*(Display_Journal('journLib','Journal',-日志库和名称-'receiverLib','Receiver',-接收器库和名称-CAST(null为TIMESTAMP),-开始时间戳-CAST(null为DECIMAL(21,0)),-起始序列号-'',-日记代码-'',-日记条目-'','',-对象库,对象名称-'','',-对象类型,对象成员-'',-用户-'',-作业-''-程序-
) ) as x ))为x

它与您描述的不完全相同,但是Tools / 400 EXPJRNE免费软件实用程序可以称为存储过程,也可以包装在自定义存储过程中,该存储过程也将返回结果集。

您可以使用一些包装代码创建存储过程或函数,以调用“ 检索日记条目”(QjoRetrieveJournalEntries)API

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

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