Skip to Content.
Sympa Menu

freetds - RE: Output parameters (was: Strange things)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Output parameters (was: Strange things)
  • Date: Thu, 21 Nov 2002 06:13:13 -0500 (EST)


On Thu, 21 Nov 2002, James K. Lowden wrote:

> Bob, what version was your server? 2000, yea?

Yes.

Microsoft SQL Server 2000 - 8.00.534 (Intel X86)
Nov 19 2001 13:23:50
Copyright (c) 1988-2000 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 2)

>
> Bob's code looks about like this:
>
> check(SQLAllocStmt(dbc, &stmt));
> check(SQLPrepare(stmt, "{call t0022(?)}", SQL_NTS));
> check(SQLBindParameter(stmt, 1, SQL_PARAM_OUTPUT, SQL_C_SLONG,
> SQL_INTEGER, 0, 0, (UCHAR*)&id, 0, &cb));
> check(SQLExecute(stmt));
> printf("id = %d\n", id);
>
> That's the ODBC way to get an output parameter without selecting it,
> I guess.

I think of the ODBC interface as the more natural approach to getting
values from output parameters -- binding them to local storage rather
than nudging them into a result set. I assume that Brian didn't have
any choice when he created the test for the older version of the
protocol; in fact it was a pretty clever workaround for the limitations
of a protocol which didn't have any real support for invoking stored
procedures.

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com






Archive powered by MHonArc 2.6.24.

Top of Page