× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 9/28/10 2:56 AM, Kevin Passey wrote:

I have two issues I am working on.

1. Is there anyway of suppressing the copy when testing the schemata
file for a library existence test.

The query is unlikely to ever operate without the temporary copy. Little matter anyhow, as the primary work to obtain the data is going to have a similar effect of delaying access to the data; i.e. having completed before starting the query, effectively, the request to:

DSPOBJD QSYS/*ALL *LIB *FULL OUTPUT(*OUTFILE) OUTFILE(QTEMP/QQQSCHEMAS)

Notice the definition of the VIEW, which is created as the result of a TABLE FUNCTION [UDTF] in the FROM clause, and omitting rows not authorized to the user using a FUNCTION [UDF] in the WHERE clause:

CREATE VIEW SCHEMATA AS
SELECT ...
FROM
TABLE (SYSIBM.SCHEMAS()) AS A
WHERE
SYSIBM.SQLGETAUTH( 'QSYS', ODOBNM, 'LIB '
, ' ', X'FF3C' ) <> '2'

Here is the SQL I'm testing..

SELECT * FROM qsys2/SCHEMATA fetch first row only for read only

2. Which schemata should I use - sysibm or qsys2


I would suggest using neither; using instead, your own UDF, VIEW, or TABLE according to the needs\desire.

For a simple existence test [optionally authorization], I would wrap the CL request CHKOBJ QSYS/&LibName *LIB AUT(&MinAut) in a UDF, then use a SET or VALUES INTO. If the data\effect must more closely mimic the SCHEMATA catalog VIEW [i.e. rows], then...

For [continued] lack of the System Database Cross Reference [QADB* files in QSYS] properly tracking creation of all library objects, only libraries with a database or DDM device file will be available in the QADBXREF file. If only *LIB objects with either a DBF or DDMF is acceptable, then a VIEW [or adopting program] referencing QADBXREF would suffice. If all library objects must be available, depending on how stale or limits on the capability to enable active tracking by your own code\coding, then either maintain the data tracking all [created; by CRTLIB or RSTLIB] library objects in a TABLE or use a TABLE FUNCTION using an API like QUSLOBJ [effecting similar to SCHEMAS in SYSIBM, with your own rows optimization and optional selection according to the authority\capability by the invoker].

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.