Create Alias

5 pts.
Tags:
Multi-Member
SQL/400
How can you use "create alias" to return all members of the primary file? I understand how this is done with one member. but how can you build the file using all member via a wildcard function

Software/Hardware used:
iseries

Answer Wiki

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

Discuss This Question: 3  Replies

 
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
  • TomLiotta
    How can you use "create alias" to return all members of the primary file? AFAIK, unless it's a partitioned table, you can't. SQL doesn't handle members. If you need SQL to process all rows in a table, the data shouldn't be put into multiple members. But if you are already stuck with members. you can create a logical file that includes all members if it's a keyed logical. Since you probably have been stuck with multiple members, that might be your only choice for creating a permanent object. And since it can be done with a simple logical file, there doesn't seem to be much reason to allow an ALIAS to do it. If anybody knows an alternative, it'll probably get posted here. Tom
    125,585 pointsBadges:
    report
  • BigKat
    not elegant, but you could create a UNION statement over multiple ALIASed members
    create alias s1...
    create alias s2...
    ...
    create alias sn...
    
    select * from s1
    union
    select * from s2
    union
    ...
    select * from sn
    
    8,200 pointsBadges:
    report
  • philpl1jb
    If you need to automate the process you could use DSPFD MBRLIST to an outfile Have an SQL-RPGLE read each member and 1. Issue an SQL to Create the Alias 2. Add to a string for the Create View as ' the additonal ... ' union select * from ' + aliasName Once all the members have been processed run the string as a dynamic SQL .. once the view is created you can use it like a file Phil Phil
    49,940 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