MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » January 2014

RE: SQL query by object creation date



fixed

I don't have a machine new enough to try it, but I think you should be able to do something like this:
With xx as (select x.* from table(QSYS2.OBJECT_STATISTICS('QSYS', '*LIB")) as x)
SELECT * FROM SYSTABLES WHERE name in (select xx.name from xx)

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Bdietz400
Sent: Monday, January 13, 2014 4:46 PM
To: Midrange Systems Technical Discussion
Cc: Midrange Systems Technical Discussion
Subject: Re: SQL query by object creation date

I have been playing with this new function. Making my own generic dspobjd.
Since it's SQL I can use better *generic* selections for the object.

I have bee trying to figure out how to, in one SQL statement, use the output
from
SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('QSYS','*LIB')) AS x
As input to a second statement for the object selection.

Any ideas?

--
Bryan


On Jan 13, 2014, at 1:55 PM, Matt Olson <Matt.Olson@xxxxxxxx> wrote:

This is great, but how do you do this for all librarys and all files?

I tried:

SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('','')) AS x

Hoping that would give me everything, and different combinations of
above query but nothing.

Here is what I did to get what I needed:

SELECT * FROM QSYS2.SYSTABLES
ORDER BY last_altered_timestamp



-----Original Message-----
From: Jack Callahan [mailto:jjcllhn@xxxxxxxxx]
Sent: Monday, January 13, 2014 10:31 AM
To: midrange-l@xxxxxxxxxxxx
Subject: RE: SQL query by object creation date

If you're on i7.1 TR7, there's a table function QSYS2.OBJECT_STATISTICS()
that will provide an object creation timestamp without having to use the
DSPOBJD command.


https://www.ibm.com/developerworks/community/wikis/home?lang=en#!
/wiki/IBM%20i%20Technology%20Updates/page/QSYS2.Object_Statistics%2
0table%20function%20ease%20of%20use
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.








Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact