Tuesday, March 20, 2012
calling DB2 store procedures from SQL Server 2000
Has anyone come across doing this and how they did it?
THanks for the help...How did you connect to DB2?|||I am using ODBC to connect to the DB2 database. I have setup DTS scripts to do inserts into DB2 database with success using the Other ODBC connection.|||Did you try setting up a linked server to DB2?
What platform is DB2 on?
O/S 390? AS400? UNIX?
What version of DB2 (not important, just curious)
You mention stored procedure and DTS...which one are we talking about?
Can you select data from DB2 in QA?|||Yes I do have linked server to the DB2 database.
I am not sure the platform but I believe it is Unix.
The version of DB2 is 8.x
I can select data from DB2 using the OPENROWQUERY statement.
I am using DTS to execute the DB2 Store Procedure.
I also tried to do through an ACtiveX Script:
Here is the script:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Dim con, rs, connectstr
Set con = CreateObject ("ADODB.Command")
Set connect1 = CreateObject("ADODB.Connection")
connectstr = "Provider=IBMDADB2.1;Password=xxxxx;User ID=xxxxxx;Data Source=TWDLBS1D;Persist Security Info=True"
'connectstr = "Provider=MSDASQL.1;Persist Security Info=True;User ID=xxxxxx;Password=xxxxxx;Data Source=TWDLBS1D;Mode=ReadWrite"
connect1.open connectstr
con.ActiveConnection = connect1
con.CommandText = "LAWSON.LBS_BATCH_VALID"
con.CommandType = 4 'adCmdStoredProc
'con.Parameters.Append con.CreateParameter (adInteger,adParamInput ,258)
'con.Parameters.Append con.CreateParameter (adDate,adParamInput, "2004/02/04")
'con.Parameters.Append con.CreateParameter (adChar,adParamInput, "NP")
Set rs = con.Execute
Main = DTSTaskExecResult_Success
End Function
Thursday, March 8, 2012
Calling a AS400 (IBM DB2) Stored Procedure from within SSIS Package
Hi:
I would like to find out how would I call an AS400 (IBM DB2) iSeries Stored Procedure from within my SSIS Package. What tasks should i be using? and do I need any additional adapters installed on my machine to access AS400(IBM DB2). Thanks.
MA
--Run this scrpit, AS400 is the name of your AS400 name
EXEC master.dbo.sp_addlinkedserver @.server = N'AS400', @.srvproduct=N'DB2 UDB for iSeries', @.provider=N'MSDASQL', @.datasrc=N'AS400', @.catalog=N'AS400DBNAME'
-- It will create a linked server name AS400, dtascrc parameter is the name of ODBC_DSN
--Open this linked server and add the UserID/Password--
Once this is done, then use the following to call the stored proc
Exec ('Call Library.StoredProc (?)') AT AS400
Task Name is Execute SQL Task, iSeries Navigator/drivers should be installed on the server.
This is very good article on this
http://www.mcpressonline.com/mc/.6b344718