Have you tried to create an SQL index over all partitions?
CREATE INDEX LIBNAME.INDEXNAME
ON LIBNAME.TABLENAME(COLUMNNAME)
NOT PARTITIONED
... and have you tried to use this index in composition with native I/O.
(note: an SQL index cannot be specified in an SQL statement but used in composition with native I/O like any keyed logical file).
From the documentation:
When the file (SQL table) becomes partitioned, the file becomes a multimember file and the traditional system application needs to specify the member name (partition name).
The traditional system application can avoid having to specify a member name when reading or writing data by changing the application to use an SQL index that is based on all the members of the physical file.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization – Education – Consulting on IBM i
IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Code 1109 via RPG400-L
Sent: Wednesday, 12 April 2023 21:35
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: Code 1109 <code1109@xxxxxxxxx>
Subject: Partitioned Table not letting me write to it
Hello all, I have a partitioned SQL table with a LF over it and I have a quick proof of concept pgm to test writing (using the LF) the value of 1012729793 but it doesn't do it. While debugging I get this: "Member number needed for member [my file]"
The table has 5 partitions by range of a 15,0 numeric field named Field001:
Partition by Range ( Field001 nulls last) ( Partition PART000001 Starting (1) InclusiveEnding (750000000) Inclusive, Partition PART000002 Starting (750000001) InclusiveEnding (1500000000) Inclusive, Partition PART000003 Starting (1500000001) InclusiveEnding (2250000000) Inclusive,
etc..)
Can someone provide guidance on what I'm doing wrong and how to fix it? Many thanksRamon S.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.