280 pts.
 Querying multiple member PF with SQL
I would need to SQL on a multiple member PF and I need to query the 2nd or nth member in the PF.  Is this possible just with an SQL query without using OVRDBF etc.?


Software/Hardware used:
AS400
ASKED: February 11, 2010  8:17 AM
UPDATED: February 15, 2010  6:07 AM

Answer Wiki:
You have to know the name of the member. CREATE ALIAS on the PF to the specific member name. Then in SQL just SELECT FROM ALIAS. =========================================================== OVRDBF is appropriate for individual jobs. The override is temporary and does not affect other jobs. CREATE ALIAS creates a permanent "override" to a specific member. An ALIAS would be created for each member; each ALIAS would have a unique name within the schema; and all jobs would use the same ALIAS for the same member. (You could create multiple ALIASes over the same member if you wanted to.) One is temporary and limited in scope. The other is permanent (until you DROP ALIAS) and available system-wide. SQL does not have a concept for "member". In general, if you're going to use SQL, then don't use members. OVRDBF and CREATE ALIAS provide two methods to use when member access is required. Note that "partitioned" TABLEs may provide a form of "member" access for new TABLEs. The DB2 Multisystem product enables partitioned TABLEs on AS/400s, I think as of V5R3. Tom rajgoaj: The SQL syntax for this would be CREATE ALIAS aliasname FOR tablename(membername)
Last Wiki Answer Submitted:  February 15, 2010  6:07 am  by  TomLiotta   107,735 pts.
All Answer Wiki Contributors:  TomLiotta   107,735 pts. , Littlepd   1,130 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Perfect solution TomLiotta, thanks!

 280 pts.