AS/400 DB2 linked server problem

I'm using MS-SQL management studio and added linked server on my environment.
I can use openquery for my linked server.

ex)
select * from openquery(linked_server, 'SELECT * FROM [LIB_NAME].[PF_NAME]')

It works fine.
But, I wanna know if I can change the above expression like this.

select * from [linked_server].[LIB_NAME].[PF_NAME]

Of course, I failed.. Please let me know how this can work.
Thanks.




LVL 1
co2twAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

momi_sabagCommented:
sql server uses 4 part names, so you just need to try some combinations for your query
try

select * from [linked_server]..[LIB_NAME].[PF_NAME]
select * from [linked_server].[LIB_NAME]..[PF_NAME]
0
co2twAuthor Commented:
I tried your query but I also failed.
please give me the descript of the 4 parts.

[linked_server].[what?].[LIB_NAME].[PF_NAME]
[linked_server].[LIB_NAME].[what?].[PF_NAME]
0
momi_sabagCommented:
try

EG Query: SELECT * FROM AS400.HJL.BEL.REL
In this query:
AS400 = Linked Server Name on SQL
HJL = AS400 Hostname / Machine Name (this could also be the server IP)
BEL = The library from which we want to select data
REL = Table

took it from
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=138160
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

co2twAuthor Commented:

I also tried but failed.

I'm sure that my server's machine name is correct and I also tried my ip address of the server.
But failed...
Do you have any other clue for this?
0
momi_sabagCommented:
what is the exact error message you get?
0
co2twAuthor Commented:
the error message is below.

An invalid schema or catalog was specified for the provider "MSDASQL" for linked server "DNA".
0
momi_sabagCommented:
is it possible that this is a permission issue?
can you trace the As400 DB2 and check if your request ever made it through
0
co2twAuthor Commented:
I didn't solve this problem yet but I'll accept the answer.
If the description for the connection 4 parts is correct, there might be a clue.
Anyway thanks.
0
co2twAuthor Commented:
It didn't solve my problem absolutely but It gives me a clue to solve.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.