Skip to Content.
Sympa Menu

freetds - Re: 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: Re: Stored Procedures & MSSQL & CTLIB
  • Date: Wed, 13 Nov 2002 18:32:52 -0000


Hi

I do appologise for not ending that mail, one of them days i'm afraid - hit
the wrong key and sent the mail by accident ;/

Anyway....

Are Stored Procedures working in CTLIB? Or have I got completely the wrong
end of the stick on using ct_param?

Any help you could give would be appreciated.

Regards

Darren Smith
Game Digital Ltd

----- Original Message -----
From: "Darren Smith" <data AT barrysworld.com>
To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
Sent: Wednesday, November 13, 2002 6:30 PM
Subject: Stored Procedures & MSSQL & CTLIB


> 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