Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    3

    Question Unanswered: calling DB2 store procedures from SQL Server 2000

    I am trying to call DB2 stroe procedure from within SQL server 2000 using DTS. I have the IBM odbc driver installed on the server. I have created an ACtiveX script to run in DTS and it fails staing it could not findor load the DB2 store procedure.

    Has anyone come across doing this and how they did it?

    THanks for the help....

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    How did you connect to DB2?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Posts
    3
    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.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Feb 2004
    Posts
    3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •