Skip to Content.
Sympa Menu

freetds - Stored Procedures & MSSQL & CTLIB

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Darren Smith" <data AT barrysworld.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Stored Procedures & MSSQL & CTLIB
  • Date: Wed, 13 Nov 2002 18:30:29 -0000


Hi folks

I'm trying to access some stored procedures on our MSSQL7 server from a
program i'm writing in C.

I'm having some difficulty in executing any SP however :(

As a test I have a small SP on the server:

sp_GetUserIDFromName( @lngUserID is returned as a RETURN, type int &
@strName varchar(50) )

With Connecting to the SQL Server, logging in etc, i've had no problems
with, But trying to set a parameter on the SP core's every time:

He's a snippit of code:

#
CS_INT lngUserID;

memset(&datafmt, 0, sizeof (datafmt));
strcpy(datafmt.name, "@lngUserID");
datafmt.namelen = CS_NULLTERM;
datafmt.datatype = CS_INT_TYPE;
datafmt.maxlength = CS_UNUSED;
datafmt.status = CS_RETURN;
datafmt.locale = NULL;

ret = ct_param(cmd, &datafmt,(CS_VOID *)&lngUserID, sizeof(CS_INT),0);
#

#0 0x280865b6 in ct_param (cmd=0x804b0a0, datafmt=0xbfbffaec,
data=0xbfbffae8, datalen=4, indicator=0) at ct.c:1348
1348 param = tds_add_input_param(dyn);
(gdb) bt
#0 0x280865b6 in ct_param (cmd=0x804b0a0, datafmt=0xbfbffaec,
data=0xbfbffae8, datalen=4, indicator=0) at ct.c:1348
#1 0x8048ca4 in main ()
#2 0x8048975 in _start ()






Archive powered by MHonArc 2.6.24.

Top of Page