|
CREATE TABLE MYLIB/MYTABLE
(
FIELD1 CHAR (10),
FIELD2 CHAR (10),
FIELD3 CHAR (10),
FIELD4 CHAR (10),
PRIMARY KEY (FIELD1, FIELD2)
)
RCDFMT MYTABLERCD
create index mylib.myindex
on mylib.mytable (field4)
where field3='X'
rcdfmt MYTABLERCD add all columns
When I use RUNQRY FILE(MYLIB/MYINDEX)
against that file I am getting:
QRY1045 - File MYINDEX in ROB cannot be queried.
CPD4360 - Queried file MYINDEX in ROB not data base file or is an SQL
derived key index.
If I drop BOTH the WHERE clause, and the RCDFMT clause, I can then use
RUNQRY QRYFILE(MYLIB/MYINDEX)
https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajq/rzajqderivedindex.htm?lang=en-us
Normally when I think of a "derived index" I am thinking something like
FIELD1 CONCAT FIELD3 or (annualWage/52).
Apparently using these two clauses gets it thinking it's a derived index.
A WHERE clause should be considered a "sparse" index and not a "derived"
index and therefore should be fat dumb and happy at 7.2.
https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzajq/rzajqsparseindexuse.htm?lang=en-us
Too bad that is not what I am seeing...
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
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.