Re: XA Transactions / Sending raw TDS packets through ODBC

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.