Querying multiple member PF with SQL

280 pts.
Tags:
AS/400 SQL
DB2
Physical Files
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

Thanks. We'll let you know when a new response is added.

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)

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Rajgoaj
    Perfect solution TomLiotta, thanks!
    280 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following