Skip to Content.
Sympa Menu

freetds - [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Debrot, Ed" <Debrot AT addsys.com>
  • To: "freetds AT lists.ibiblio.org" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Using a CS_NUMERIC type as a parameter to a stored procedure
  • Date: Mon, 27 Jan 2020 18:38:41 +0000

We are porting an application written using ctlib against Sybase ASE to one
using freetds and working with SQL Server. The application has worked for
many years in the old configuration (ctlib and Sybase ASE). In the
application we call stored procedure using ct_command() and send in
parameters using ct_param().

When using freetds and SQL Server we have found that we have not been able to
pass a stored procedure parameter when that parameter is of type CS_NUMERIC.
The parameter is passed successfully in the old configuration so I believe
the mechanics are correct.

When compiling and running the same code for use with freetds and SQL Server
we get an error (below) that the first parameter is not passed but I know
that it is.

Is there a limitation in freetds having to with passing CS_NUMERIC types as
stored procedure parameters using ct_param()?

>>>
>>> error message
>>>
message string is
Procedure or function 'RECEIPT_FREIGHT_k0_ge_sp' expects parameter
'@arg1', which was not supplied.
error number=201, severity=16
state=4, line=0
Server='ADD-MSSQL-DEV'
Procedure='RECEIPT_FREIGHT_k0_ge_sp'
>>>

>>>
>>> stored procedure definition
>>>
create procedure dbo.RECEIPT_FREIGHT_k0_ge_sp @arg1 int, @arg2 numeric
as
select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0))
where status="A" and receipt_id = @arg1 and internal_id >= @arg2
union all
select * from RECEIPT_FREIGHT with (index (RECEIPT_FREIGHT_KEY0))
where status="A" and receipt_id > @arg1
>>>








Archive powered by MHonArc 2.6.24.

Top of Page