Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Through query to create an alias for DB2 member

Status
Not open for further replies.

ziffer68

Programmer
Apr 25, 2024
1
GB
Hi, does anyone know much about using Aliases in pass through queries to get member data from DB2?
I have a query that does the pass through, which when it runs, asks which ODBC source to connect to.
This works and I can then create a linked table to the alias
Pass through query:
Create or replace alias LibrarytoCreateAliasIn."Alias Name" FOR LibraryofSourceTable.SourceTableName(Member)

I can currently do this all manually, via queries in MS Access, but would love to be able to automate it.
If possible, can anyone point me in the right direction to programmatically create the alias via VBA, passing in strings with the correct library, table names and members, automatically link to the correct ODBC, get the data, do what I need to do with the data, then drop the alias.

On my first go I could link to the ODBC, and make the connection, but I could not get the above pass through query to run.

Has anyone successfully done this with aliases and DB2 member data before? Can anyone help?

Cheers Ziffer68
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top