Skip to Content.
Sympa Menu

freetds - Re: [freetds] XA Transactions / Sending raw TDS packets through ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] XA Transactions / Sending raw TDS packets through ODBC
  • Date: Thu, 13 Mar 2008 17:56:45 -0400

Laurence Rowe wrote:
> how can I send a raw TDS packet through the ODBC
> interface?

USTL!

You have access to the raw socket via the connection handle. It's just a
SMP to cast it to the right type, grab the descriptor, and write(2) your
packet. Is that what you're looking for?

Cf. INIT_HDBC in src/odbc/odbc.c:121. You will find that

HDBC is a TDS_DBC*
is a struct _hdbc* that
has a TDSSOCKET* named tds_socket that
is a struct tds_socket* that
has a TDS_SYS_SOCKET named s that

is probably just an int in tds_sysdep_public.h.

If there's a blessed ODBC way, I don't know about it.

> It seems the packets are very simple

Sure. The rest of the code is mostly comments and filler, as you can see.
;-)

HTH.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page