Example of how to call a stored procedure from C using dblib - needed desperately



Hello,

I desperately need a small example that shows how to call a simple
stored procedure that returns an integer. I need a solution in C that
uses dblib. I am in an environment that is using an ancient mix of
technologies. We have an old version of solaris, an ancient sun C++
compiler and an ancient version of RogueWave dbtools++. The project
uses a closed-source third-party component that is a C library. By
wrapping parts of this library using SWIG I have managed to move the
project into java-land where I can do most of the sybase access using
JDBC. But there is one small bit where I have to use dblib and the
third-party library to do some stuff inside a two phase commit. This
work involves calling a stored procedure.

I could split up the work so that the open_commit is started, I then
return to java to invoke the stored proc, then go back into my C lib
via SWIG/JNI and complete the transaction but I really dont want to do
that.

Can anybody help please? I realise this is ancient stuff and maybe
thats why I cannot find much via google. The dbrpcinit routine seems
to be particularly cryptic. I am not sure what to do about the last
parameter for example.

Regards,

Andrew Marlow

.