Ask the Expert

Chose an AS/400 file member on the SQL SELECT statement

Is there a way to chose an AS/400 file member on the SQL SELECT statement?

The concept of multiple member files (tables) is foreign to SQL. However, as we all know, DB2 for the iSeries supports multiple member files.

In order to access any member other than the *FIRST one in a file you would have to do one of the following:

1. Create and alias pointing to the member you want to work with.
CREATE ALIAS AA for LIB.FILE(MBR) You would then reference table AA to select from your member....

2. You could use the Override Database File (OVRDBF) in your CLP, prior to executing a SQL statement.
OVRDBF FILE(file_name) TOFILE(lib_name/file_name) MBR(mbr_name)

This was first published in May 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

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
Sort by: OldestNewest

Forgot Password?

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

Your password has been sent to: