[freetds] Best way to do RPC ?

Raphael Hertzog eng at eipm.ch
Wed Apr 9 04:55:14 EDT 2003


I want to launch Remote Procedure Call from a Linux PC. Thus I found
freetds and decided to use it.

First disappointment, sqsh uses ctlib and isn't able to do RPC with
parameters because CTLib doesn't support that. I looked in the archives
and discovered that DBLib supports RPC with parameters.

I decide to try that and I write a little test program (cf testftds.c in
attachment). The program works well except that it doesn't return
anything (whatever the parameter I give) ... the result set returned is
always empty and it shouldn't.

Can you tell me what's wrong in what I did ? You can test it if you have
a SQL Server 2000 installed somewhere ... I use the sample database
"pubs" for the test. You just need to add a [demo] section to your
/etc/freetds.conf file ... I tried several version of the protocol (7,
8, 4.2) without success.

Otherwise, I tried tsql and there it worked without problem (sending
"byroyalty @percentage=100\ngo").

In your opinion, what's the best way to manage RPC right now ? With
DBLib ? with tds_submit_query directly, bypassing at the same time all
the checks (like it's done in tsql) ?

Raphaël Hertzog - EIPM SA

More information about the FreeTDS mailing list