SQL Alias visibility

40 pts.
Application development
We have found that creating an SQL alias works for accessing file members in embedded and interactive SQL. But if we create an ALIAS in our live libraries with the intention of keeping it for frequent use, how do we know it exists other than WRKOBJ? It doesn't show up in DSPDBR. And is there really a benefit to not creating it in QTEMP everytime we want to use it? And finally, is there a different way to access multiple data members in SQL statements other than ALIAS?

Answer Wiki

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

You can use the Over ride Data Base command to access a specific member in a multiple member file.




Discuss This Question: 2  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.
  • LeslieL
    Yes, OVRDBF is what we've used in the past but we want something easier to implement and manage. We found the ALIAS object is nice from within an interactive SQL session since you are referencing the member right there in your statement rather than managing the override state of your file. It's more visible. It's also easier than having to QCMDEXC the overrides in embedded SQL.
    40 pointsBadges:
  • WaltZ400
    As far as doing a DSPDBR to find these, this won't work as a Create Alias creates a local DDMF over the file and member. This does not show up in a dependent file listing. However, there is a system file on QSYS library named QADBXREF which contains general information regarding files created on the system. The operating system maintains this file as you create, modify or remove files. In this file there are alias information fields that show the file, library and member that the alias name was created over. You should be able to query this by selecting any record where the alias fields are not blank and you should get all aliases on the system. If you are going to access the same member off a file each time then you could leave the alias in a library other than QTEMP. However, if you use this to access random members and especially if you have this in procedures called my more than one user, you might want to go the QTEMP route. This way you can Create or Drop aliases on any member without affecting another user. The drawback is the QADBXREF file does not log files created in QTEMP libraries.
    655 pointsBadges:

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.

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


Share this item with your network: