Results 1 to 3 of 3

Thread: VB.NET and OLE Dataprovider - Calling CLP on AS400 passing parms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    VB.NET and OLE Dataprovider - Calling CLP on AS400 passing parms

    Using this code and NOT passing any parameters works fine. Finds the object on the AS400 and kicks off the job.
    It's when I add the parameter data that I error out..

    This is my code..

    Dim ConnString As String
    ConnString = "Provider=IBMDA400; Data Source=" + myas400sys + "; User ID=" + MYUSER + "; Password=" + MYPASSWORD + ";"

    Dim myConnection As New OleDb.OleDbConnection
    myConnectionConnectionString = ConnString

    Dim myCommand As New OleDb.OleDbCommand("CALL TGCLOCKRCV.TGDSQL(?)", myConnection)
    myCommand.CommandType = CommandType.Text
    myCommand.CommandText = ("CALL TGCLOCKRCV.TGDSQL(?)")

    'setup the parameters
    myCommand.Parameters.Add(New OleDb.OleDbParameter)
    With myCommand.Parameters(0)
    .ParameterName = "SERIAL"
    .Direction = ParameterDirection.InputOutput
    .Value = "STRING1"
    .OleDbType = OleDb.OleDbType.Char
    .Size = 8
    End With

    Dim results As String

    Try
    myConnection.Open()
    Catch ex As Exception
    MYERRMSG = ex.Message.ToString()
    End Try

    Try
    myCommand.ExecuteNonQuery()
    SerialNbr = SerialOut.ToString()
    Catch ex As Exception
    MYERRMSG = ex.Message.ToString()
    End Try

    myConnectionClose()

    The error message from the AS400/SQL/everyone

    SQL0204: TGDSQL in TGCLOCKRCV type *N not found.
    Cause . . . . . : TGDSQL in TGCLOCKRCV type *N was not found.
    If the member name is *ALL, the table is not partitioned.
    If this is an ALTER TABLE statement and the type is *N, a constraint
    or partition was not found. If this is not an ALTER TABLE
    statement and the type is *N, a function, procedure, trigger
    or sequence object was not found. If a function was not found,
    TGDSQL is the service program that contains the function.
    The function will not be found unless the external name and
    usage name match exactly. Examine the job log for a message
    that gives more details on which function name is being
    searched for and the name that did not match.
    Recovery . . . : Change the name and try the request again.
    If the object is a node group, ensure that the DB2 Multisystem
    product is installed on your system and create a nodegroup
    with the CRTNODGRP CL command. If an external function was not found,
    be sure that the case of the EXTERNAL NAME on the
    CREATE FUNCTION statement exactly matches the case
    of the name exported by the service program.


    Any help out there???

    Thanks

    gollnick
    William E Gollnick

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,388

    Re: VB.NET and OLE Dataprovider - Calling CLP on AS400 passing parms

    looks like when passing a parameter, the stored procedure TGCLOCKRCV.TGDSQL takes a path where a type "*N" is referenced that does not exist?
    maybe.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: VB.NET and OLE Dataprovider - Calling CLP on AS400 passing parms

    Quote Originally Posted by digitalShaman View Post
    looks like when passing a parameter, the stored procedure TGCLOCKRCV.TGDSQL takes a path where a type "*N" is referenced that does not exist?
    maybe.
    No .. I don't think so. It seems to be a data type mismatch although both are defined as Char 8 and are named the same.
    There has to be a small trick someone has accomplished before.
    But thanks
    Bill
    William E Gollnick

Posting Permissions

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



Click Here to Expand Forum to Full Width