Glenn Gundermann wrote:

Very cool Glenn, thanks. I took your example and used a materialized query table instead (I just learnt about them!) Requires V5R3 +PTFs or V5R4.

CREATE TABLE SRCFLIST as (
select system_table_name, system_table_schema, table_type, file_type
FROM systables
WHERE table_type='P' AND file_type='S')
data initially deferred
refresh deferred
maintained by user
disable query optimization'

This creates the MQT. Note that there's no data in it at this time. To get/update the data in the table:

refresh table SRCFLIST

Note there's one neat thing you can do, and that's insert your own records. If you have some need to add some internal files that you want to treat like a source file, you can:

insert into SRCFLIST values(''OURFILE'',''OURLIB'',''S'',''I'')

Thanks for the great idea to work from.
--buck

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].