Skip to Content.
Sympa Menu

freetds - RE: [freetds] state of dbrpcsend()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] state of dbrpcsend()
  • Date: Thu, 10 Jun 2004 08:46:55 +0100

A good idea would be to enable dblibrary message and error handlers.
This would then display any objections the server may have to the submitted
rpc call.

you do this as follows :

1) define the error handling functions. here's two examples:

int err_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr,
char *dberrstr, char *oserrstr)
{
if ((dbproc == NULL) || (DBDEAD(dbproc)))
return(INT_EXIT);
else
{
fprintf (stderr, "DB-Library error:\n\t%s\n", dberrstr);
if (oserr != DBNOERR)
fprintf (stderr, "Operating-system error:\n\t%s\n", oserrstr);
return(INT_CANCEL);
}
}

int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
int severity, char *msgtext,
char *srvname, char *procname, DBUSMALLINT line)
{
fprintf (stderr, "Msg %ld, Level %d, State %d\n",
msgno, severity, msgstate);
if (strlen(srvname) > 0)
fprintf (stderr, "Server '%s', ", srvname);
if (strlen(procname) > 0)
fprintf (stderr, "Procedure '%s', ", procname);
if (line > 0)
fprintf (stderr, "Line %d", line);
fprintf (stderr, "\n\t%s\n", msgtext);
return(0);
}

2) then enable them as follows:

between dbinit() and dblogin(), code :

dberrhandle(err_handler);
dbmsghandle(msg_handler);


Bill

> -----Original Message-----
> From: liam AT inodes.org [SMTP:liam AT inodes.org]
> Sent: 10 June 2004 02:08
> To: FreeTDS Development Group
> Subject: Re: [freetds] state of dbrpcsend()
>
> On Wed, Jun 09, 2004 at 03:16:19PM +0100, Thompson, Bill D (London) wrote:
>
> > to make the C code match your sp you'd have to omit the third call to
> > dbrpcparam() and capture the return status with the appropriate calls
> > to
> > dbresults, dbhasretstat and dbretstatus
>
> Thanks for your response.
>
> I've changed the code to call dbrpcparam() twice only but it still fails
> in dbrpcsend(). Again, it never reaches the wire. Given that it doesn't
> touch the wire after dblogin() is called, would it even matter if I had
> my arguments specified incorrectly? It appears something is amiss inside
> dbrpcsend().
>
> Suggestions?
>
> I might go and compile FreeTDS and dblib with -g and see what's going
> on.
>
> Cheers.
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds

==============================================================================

If you are not an intended recipient of this e-mail, please notify
the sender, delete it and do not read, act upon, print, disclose,
copy, retain or redistribute it.

Click here for important additional terms relating to this e-mail.
<http://www.ml.com/email_terms/>

==============================================================================





Archive powered by MHonArc 2.6.24.

Top of Page