473,473 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DB2 linked server from sql server 2005

55 New Member
Ok, I do not know what I am doing wrong. I have linked servers setup from SQL server 2005 to db2 using odbc dsn.

I open sql server management studio and try to call a stored procedure on db2 system.

Linked server name: PADEV
Database name: PADEV1
Database owner: PADEVM
Stored procedure name: PAWHAT

I type in for new query:
Expand|Select|Wrap|Line Numbers
  1. EXEC PADEV.PADEV1.PADEVM.PAWHAT
Errors:
Expand|Select|Wrap|Line Numbers
  1. OLE DB provider "MSDASQL" for linked server "PADEV" returned message "[IBM][CLI Driver][DB2] SQL0969N  There is no message text corresponding to SQL error "-114" in the message file on this workstation.  The error was returned from module "DSNXEVPN" with original tokens "PADEV".  SQLSTATE=42961
  2. ".
  3. OLE DB provider "MSDASQL" for linked server "PADEV" returned message "[IBM][CLI Driver][DB2] SQL0104N  An unexpected token "1" was found following "".  Expected tokens may include:  "( END SET CALL DROP FREE HOLD LOCK OPEN PARM ALTER BEGIN CLOSE ".  SQLSTATE=42601
The stored procedure needs one variable input and outputs 9 variables. I figured in the above call knowing i left the variables off it would say, expecting EmpID(the input variable) and not supplied but i keep getting the above error.

What am i doing wrong? Something wrong in the link server setup, in my sql statement or on the db2 side?

Thanks again. Greatly appreciate it.
Sep 29 '08 #1
6 4671
ck9663
2,878 Recognized Expert Specialist
I have not done this yet, so this answer would be more of theoretical, than actual.

The error is coming from your DB2. Your SQL Server is trying to interpret it as much as it can but can't seems to. That's why you're getting a some sort of generic error.

I also don't know about DB2. But if it's like SQL Server that you can set default values to parameters, you can check it inside the DB stored proc and return the necessary error for proper handling.

-- CK
Sep 29 '08 #2
barmatt80
55 New Member
Thanks CK.....I have been side tracked with some other work and just now getting able to get back to it. I'll see what I can find out.
Oct 2 '08 #3
barmatt80
55 New Member
well no luck.

I still get the error.

There was a permission problem, but that is fixed now. The app development team said they can call the stored procedure using cold fusion like they always do.

So i am still trying to hash out the issues in calling the stored procedure via linked servers in sql server.

The server admin says the connection is set up fine, I have asked him 2 times to confirm and it is as he says.
Oct 9 '08 #4
barmatt80
55 New Member
I THINK i have made some progress.

Expand|Select|Wrap|Line Numbers
  1. EXECUTE ('CALL PAWHAT ', 9999) AT PADEV
That produces this error:

Expand|Select|Wrap|Line Numbers
  1. OLE DB provider "MSDASQL" for linked server "PADEV" returned message "[IBM][CLI Driver][DB2] SQL0440N  No authorized routine named "PAWHAT" of type "" having compatible arguments was found.  SQLSTATE=42884

Still get an error, but it looks like it is atleast making the call, i just don't have the parameters correct.

The 9999 is my employee ID as the only input, with 9 output parameters(or values) returned.

I have tried putting " ", " " for all 9 but that doesn't work?

Any idea? I think it has to be treaded like a pass through query.
Oct 9 '08 #5
ck9663
2,878 Recognized Expert Specialist
EXEC() can pass a return status. But you might need to modify the DB2 to return it as a single string separated by comma.

Also you might be able to do a

INSERT INTO @TableVar
EXEC ()

Whatever the returned result of EXEC will be inserted on the @TableVar. Create your @TableVar with 9 columns.

-- CK
Oct 9 '08 #6
barmatt80
55 New Member
I'll give it a shot! Thanks!
Oct 9 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kharless | last post by:
Greetings, If I use a "select into" to clone a table, all attributes are created correctly, however, if I use the same statement across a linked server, my identity column loses its IDENTITY...
3
by: RandyMartin | last post by:
<<cross posted from microsoft.public.sqlserver.server>> Environment: Windows 2003 Standard Edition SP1, SQL 2005 EE RTM (both servers) I am getting the following messages when I run this...
4
by: David Kirkman | last post by:
An Access 97 linked server in SQL Server 2K has recently stopped working. In Enterprise Manager, the following error message appears when attempting to view the list of tables in the linked server:...
2
by: Larry Bertolini | last post by:
Is there a way to read data from a linked server, within a transaction, without using DTC? The data on the linked server is static, therefore there is no need for two-phase commit. There is no...
6
by: pb648174 | last post by:
I have a web server and database server which are not on a domain. The web server has an app that is running on under the IUSR account and there is a corresponding IUSR account on the database...
6
by: Neil | last post by:
After creating a linked server to a remote server, I needed to log in using sp_addlinkedsrvlogin to get my stored procedure to work. However, I noticed that after stopping SQL Server and the DTC...
2
by: Neil | last post by:
Can one use Truncate Table on a linked server table? When I try it, I get a message that only two prefixes are allowed. Here's what I'm using: Truncate Table svrname.dbname.dbo.tablename
0
by: cliffeh | last post by:
Hello, I'm trying to create a linked server in Microsoft SQL Server 2005 x64 with SP1 on Windows 2003 Standard x64 with SP1 to an iSeries with V5R2, using Client Access V5R3, service level SI24723....
2
by: sqlgirl | last post by:
Hi, We have 2 servers. Server1 is a 2000 box, with SP3 (yes I know it is not up to date). Server2 is a 2005 box, SP2. I set up Server1 (2000) to have a linked server to Server2 (2005). The...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.