DB2 Stored Procedure error

I have written an agent to execute an SQL Stored Procedure (SP) in DB2. The SP has been given to me by another developer, and I have been assured it is working fine. The SP takes two input parameters and should return a result set. The agent I am using (submitted via a web page) works up to the point of calling the SP - but when the call is submitted the agent falls over with the following error: "Stored Procedure is invalid or parameter names are incorrect. Method -Call- (12325)"I have checked that the input parameters I am supplying are correct (they are). Has anyone got any ideas as to what I can check next? Here is the relevant code:

Uselsx “*LSXLC”

Dim lcSess As New LCSession

Dim lcConn As New LCConnection(“db2”)

Dim input_params As New LCFieldList

Dim result_set As New LCFieldList

Dim PO_I As LCField

Dim PO_LINE_I As LCField

Dim lcCount As Long

lcConn.Database = sDBName

lcConn.UserID = sUName

lcConn.Password = sPW

lcConn.Procedure = sProcName

lcConn.Connect

Set PO_I = input_params.Append(“PO_I”,LCTYPE_TEXT)

Set PO_LINE_I = input_params.Append(“PO_LINE_I”,LCTYPE_TEXT)

PO_I.Value = inputPONum

PO_LINE_I.Value = inputPOLine

** FAILS HERE **

lcCount = lcConn.call(input_params,1,result_set)

Thanks in advance…

Subject: DB2 Stored Procedure error

I’ve actually managed to get this working - the stored procedure input parameters I was given, and hence using, were in fact wrong! Once I had got someone I trust(!) to analyze the procedure I could find out the correct names of the input parameters. The problem I am having now is that the line:lcConn.Call(input_params,1,result_set)

is returning the value ‘-1’ - and I do not know what this signifies… if it was ‘0’ then that would mean no rows in the record set… but I dont know what ‘-1’ means! Further investigation required…

Subject: RE: DB2 Stored Procedure error

-1 is the numeral value for LCCOUNT_UNKNOWN which means the connector could not Identify the number of rows returned.

Now what I would like to know is why would I get an LCCOUNT_UNKNOWN… what does it mean and can you change something to get it to send you a good count call…

anyone?