質問

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

他のヒント

It's not exactly what you describe but the Tools/400 EXPJRNE freeware utility could be called as a stored procedure or could be wrapped in a custom stored procedure that would return the result set as well.

You could create a stored procedure or function with some wrapper code to call the Retrieve Journal Entries (QjoRetrieveJournalEntries) API

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top