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