Skip to Content.
Sympa Menu

freetds - Re: [freetds] ask a question about stored procedure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ask a question about stored procedure
  • Date: Wed, 26 Oct 2005 08:25:17 +0100

Hello lichunlei,

> i am a programmer from china, i need to use freetds...

that may be a new "market" for us. Welcome.

freetds is merely a transport mechanism, allowing unix/Linux (and other)
client applications to communicate with SQL Server.
We provide the means whereby an application program can submit commands
to a SQL Server, and process the results.

We provide several API's, compatible with industry standards, that
encapsulate the low-level communications protocol between client and
server.
These API's are dblibrary, ctlibrary and ODBC.
All of these API's are documented in the public domain. You first need
to decide which API you are going to use.

Any valid SQL command can be submitted to the server through any of the
API's.
A command can be submitted as ascii text, having first been constructed
in your application program.

For example, and using the dblibrary API, you could do the following

char command[512];
strcpy(command, "BEGIN TRANSACTION"); /* or "COMMIT TRANSACTION */
dbcmd(dbproc, command);
...

or:

char command [512];
int myvar;

myvar = 3;
sprintf(command,"EXEC dbo.myprocedure @inparm = %d", myvar);
dbcmd(dbproc, command);
...

This would probably be the simplest method for you to use.
One case would necessitate a different approach - if you wanted to use
OUTPUT parameters to a stored procedure.

in dblibrary, you would have to use some special API functions:
dbrpcinit() dbrpcparam() and dbrpcsend(), if you want to capture into
your program the values of OUTPUT parameters to a stored procedure. The
other APIs also have special methods for dealing with this case.

I hope this gives you a start. If you have any more questions, just ask.


Bill

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
lichunlei AT kingsoft.com
Sent: 26 October 2005 06:42
To: freetds AT lists.ibiblio.org
Subject: [freetds] ask a question about stored procedure


hi:

i am a programmer from china . now , i need to use freetds in linux
environment to access mssql server . but ,i do not know if the freetds
support 'stored procedure' and 'transaction' . if the answer is yes ,
how to support it . thanks for your help .


lichunlei
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page