简体   繁体   中英

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. It worked without having to use DSPJRN etc. It invoked a stored procedure and the results came directly back to the SQL session. Unfortunately I have since lost the info.

Does anyone know the stored procedure name and how to write the SQL statement?

Found it. It works via a UDTF - user defined table function - provided by IBM.

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/

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 --
) ) as x

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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