Skip to Content.
Sympa Menu

freetds - [freetds] rpc strategy

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] rpc strategy
  • Date: Sat, 23 Nov 2002 01:28:31 -0500

Hello everyone,

Frediano told me rpc is "quite done" in libtds, but I think we're speaking
of different things that might overlap somewhat. I've been reading about
the dblib rpc fuctions, trying to mate them to the TDS documentation, and
AFAICT, what I'm trying to do is quite different from "dynamic SQL". What
I'm doing has no placeholders.

This message is an outline of what I think is needed. Please chime in to
keep me on track.

What I have done so far is define the data structures to hold what the
client application passes to db-lib. I'm now wrestling with dbrpcsend(),
which dereferences all those captured values and sends the appropriate
packets to the server.

I propose a 1:1 mapping of TDS token to libtds function, passing a data
structure/parameters sufficient to construct the packet. In fact, I'd
like to divide libtds along those very lines: a "token layer" to be called
by the client APIs, one per token, and a "wire layer" of internal
functions to support the token layer.

Toward that end, I see flow control like this:

1. dbrpcinit
2. dbrpcparam
[repeat 2 as for each param]
[repeat 1, 2 for each proc]
3. dbrpcsend
^^-dblib-^^
vv--tds--vv
4. TDS_DBRPC (sends proc name)
5. TDS_PARAMFMT (sends param types)
6. TDS_PARAMS (sends param data)
7. TDS_DONE_[MORE|FINAL]
[repeat 4..7 for each proc]
[return status to dbrpcsend]
^^--tds--^^
vv-dblib-vv
8. dbsqlok (waits for first result set)

Thenceforward, process results as usual, including output parameters.

There's no TDS_DBRPC definition in tds.h, leading me to think I'm the
first guy to work on this. If I'm going down the wrong path, though, I'd
sure appreciate a map.

Thanks.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page