Direct an SQL statement

pts.
Tags:
AS/400
Alex wrote in with this question recently: "I'm using VB code in an Excel spreadsheet to extract data from an iSeries multi-member file. Is there a way to direct the SQL statement I'm building to look at a specific member?" Do you know how this can be done? -- Debra Tart, associate editor, Search400.com

Answer Wiki

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

In iSeris SQL you can do a CREATE ALIAS to a specific member in the file using the following code:

CREATE ALIAS QTEMP/alias_name FOR lib/file (member)

The alias name can be treated like a file such as doing a SELECT * from alias_name. It will be pulling data only from that member. When you are done using the alias, do a
DROP ALIAS alias_name

Don’t know, however, for sure if this will work in VB SQL.

======================================================

An ALIAS is a SQL-specific way of accessing particular members. It is a SQL extension for DB2 on System i. You can also issue an OVRDBF command before issuing a SELECT (or DELETE, UPDATE or INSERT) to have the SELECT operate on a particular member. An override will remain in effect for the connection or until deleted and only affects that connection, while an ALIAS is a permanent object that’s available across the system.

Tom

Discuss This Question:  

 
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

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