[freetds] Named Instances
James K. Lowden
jklowden at schemamania.org
Wed Apr 6 20:56:03 EDT 2005
Brett <generica at email.com> wrote:
> Thanks for the info,
> It does seem to be connecting to the right instance, but I'm just having
> a lot of trouble understanding this library. There doesn't seem to be
> any simple instructions on the rudimentary operations I want to do:
> connect to a server, instance (got that part)
> perform a sql operation - call a stored procedure (got that part)
> get the row count for the operation ????
> iterate through, grabbing each row returned ????
> disconnect (got that part)
> I hate to be a bother, but honestly, I've looked at the unittests, and
> searched on the web, and inspected the header files, and there just
> doesn't seem to be examples that cover such a simple operation.
You're talking db-lib, right? I wrote src/apps/bsqldb.c just for you. It
does all the basics: connects, issues arbitrary queries, fetches rows
(regular and compute), and the rowcount if there is one, handles nulls,
checks for error conditions. db-lib is also documented in the FreeTDS
Reference Manual, although the vendors' websites do a more thorough job.
If you need return codes and output parameters from stored procedures,
IMHO src/dblib/unittests/rpc.c is a useful example of how to use the rpc
functions. If you have questions about it, feel free to post them here.
More information about the FreeTDS