April 1, 2011 at 11:16 am
I'm trying to execute a stored procedure on DB2 from sql2008.
I set up a linked server that works (I'm able to select data using openquery())
SQL Server 2008 running on Windows Server 2003 (32 bit)
DECLARE @a varchar(100)
DECLARE @b-2 varchar(100)
DECLARE @C varchar(100)
EXEC ('Call [PSDPROD].[STAGE].[DYN_CCFF_DRIVER] (2011,?,?,?)',@a output,@b output,@c output)
at TUGBOAT
The output I'm getting is not helping me at all.
OLE DB provider "DB2OLEDB" for linked server "TUGBOAT" returned message "Routine "*F_DRIVER" (specific name "SQL110401120425900") is implemented with code in library or path "...tion/PSDPROD.STAGE.DYN_CCFF_DRIVER", function "*" which cannot be accessed. Reason code: "4".".
Msg 7215, Level 17, State 1, Line 7
Could not execute statement on remote server 'TUGBOAT'.
Anyone?
April 1, 2011 at 1:45 pm
The site SQL Reports has a great SQL tutorial. Highly recommended for people just getting started on SQL selects.
SQL Reports
URL 1: http://www.sql-reports.net/
Sql tutorial
URL 2: http://www.sql-reports.net/2011/03/sql-select-tutorials.html
April 1, 2011 at 2:00 pm
Did you even read my post, or perhaps did you mean to post to a different thread?
When I looked at the links you provided they were for beginners sql queries.
I've been a DBA for over 10 years, a SQL developer for over 15, and in IT for over 20.
I know how to write SQL, especially for SQL Server as I've been using it since version 6.5.
What I DON'T know how to do is execute a remote stored procedure from sql server 2008, on a DB2 database.
If you can offer any help in that area, it would be much appreciated.
Bob McC
April 1, 2011 at 5:26 pm
Fun post so far 😛
Just a hunch, but your OLE DB provider for DB2 may not support parameter substitution.
From working with some LASP (Linux, Apache, SQL Server, PHP) devs where we did not have proc output param binding capabilities you could try this technique:
CREATE TABLE #results
(
a VARCHAR(100),
b VARCHAR(100),
c VARCHAR(100)
) ;
-- please forgive the DB2 syntax if it is not correct, but you get the idea
INSERT INTO #results
(
a,
b,
c
)
EXEC (
'
DECLARE @a varchar(100)
DECLARE @b-2 varchar(100)
DECLARE @C varchar(100)
Call [PSDPROD].[STAGE].[DYN_CCFF_DRIVER] (2011,@a output,@b output,@c output)
SELECT @a as a,@b as b,@c as b
'
) AT TUGBOAT ;
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply