I have a two part question:
1) I have an as400 linked through my sqlexpress 2005. I am successfull in quering the database using this statement:
Select * From OpenQuery(MHAS400,'Select * From QGPL.DLY_PROD')
However, I would like to use the four part naming. I am using this statement, but not sure what to use for the QSECOFR.
select * from MHAS400.QGPL.QSECOFR.DLY_PROD
MHAS400 -linked server
QGPL - library
QSECOFR - user with acces to library (this is where I am not sure I have the correct info)
DLY_PROD- file/table
So what is the 3rd section of the 4 part naming convention?
2) And will I be able to accomplish my goal pulling data from both the AS400 and SQL in the same statement similiar to this...
select * from MHAS400.QGPL.??.DLY_PROD as A
inner join SQLServer.SQLDBe.DBO.SQLTable as B on B.USADATE = A.USADATE
and retrieve data from both server much like querying two sql servers?
Thanks for the help on this.
(a user doesn't normally own ... a table or view in db2... although he can have an alias or synonm defined for a table/view)
you may be able to get
mhas400.mhas400.qgpl.dlt_p
to work ...
but the second mhas400 need to be the name of the subsystem or instance of DB2/UDB on the AS400...
you need to ask the as400 dba how his system is named internally and what aliases/nicknames he's exposed wants you to use...
btw do you know the version of DB2/UDB you're trying to connect to...
hth