Problem in Calling a Parameterised SQL Server Stored Procedure---Urgent

Hi all,A Lotus notes agent is written useing LSXLC

When ever i call stored procedures in SQL Sever,an error is prompted saying the expected first parameter is of type integer.

If i pass a dummy parameter as integer it works fine…but

the problem is the second parameter whatever i send from the lotus notes(what ever data type) will always be pointing to the fisrt parameter’s datatype in SQL Stored Procedure.

Say if i send text as a second parameter to the Stored procedure then it will point to the datatype of the dummy parameter in Stored Procedure…

the agent code is as fallows also the SQL SP

@@@@@@@@@@Start of LSX LC Agent Code

Dim field As LCField

Dim fields As New LCFieldList (1)

Dim count As Integer

Set field=fields.Append(“CC”, LCTYPE_int) 'This is the dummy parameter

field.value=1

Set field = fields.Append(“Name”, LCTYPE_TEXT)

field.value=“SMSMSMSM”

Set field = fields.Append(“Age”, LCTYPE_TEXT)

field.value=“123”

Set lcSess = New LCSession

Set SQLConn = New LCConnection(“odbc2”)

With SQLConn

lcsess.ClearStatus

.Server=ServerName

.userid=User_ID

.password=SQL_

.connect

End With

SQLConn.procedure=“Insert_TestSP”

count = SQLConn.Call (fields,1,Nothing)

SQLConn.Disconnect

@@@@@@@@@@End of LSX LC Agent Code

@@@@@@@@@@SQL Stored Procedure

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_NULLS ON

GO

Create procedure Insert_TestSP

@CC varchar(50),**** what ever data type assigned to CC(dummy parameter) is taken by next parameter Name

*******Example1:- if CC is varchar(4) then i can’t send values greater then varchar(4) to Name parameter it gives me DataOverflow Error

*******Example2:-if CC is int then i can’t send charecter to Name parameter ERROR is it says source data type is of text and target is int

@Name varchar(50),

@Age char(3)

As

insert into TestSP values(@Name,@Age)

GO

SET QUOTED_IDENTIFIER OFF

GO

SET ANSI_NULLS ON

GO

@@@@@@@@@@SQL Stored Procedure

why should i use dummy parameter.

If i don’t send the dummy parameter as int form Lc code,it give me an error saying the first parameter is of type int and int should be sent

Thanks in Advance

Subject: Similar problem, bug guess? … re: Problem in Calling a Parameterised SQL Server Stored Procedure—Urgent

I’m seeing a similar problem. It leads me to suspect that the call method is offsetting the parameter list to its types. Say it somehow discovers the following parameter list:

1: first varchar(4)

2: second varchar(25)

It seems to build the list internally as:

0: first null (interpreted as int)

1: second varchar(4)

2: null varchar(25)

In other words, the name list is 0-base, and the type list is 1-base, and the processing is 0-base. So, the first paraneter gets its name properly, butr not its type, and so defaults to INT, the second gets “parameter 1,” which is in fact the correct (second) name, but the type it is pulling is that of the first paraneter, and so on.

One way to test this would be to build a procedure with three parameters. Have the first two as int, and teh third as char, see which it fails on. Then, change the proc so it is 1 int and 1 char and a third as real, see if it now fails on the second.