Skip to Content.
Sympa Menu

freetds - Re: column Type return ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: h franks <harfranks AT yahoo.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: column Type return ?
  • Date: Fri, 27 Jul 2001 12:17:02 -0700 (PDT)


Brian, the -ltds,
what does $SYBASE do.... ins't that the same... I
will attempt to do so....

<p.s. I have already started to do my own converting
but I will look into otherwise if i can get a c file
working the better)



--- Brian Bruns <camber AT ais.org> wrote:
> The unittests only deals with a small selection of
> datatypes. you can
> look up the types by number in tds.h, and the code
> to handle them is in
> src/tds/convert.c
>
> I would personally not recommend going down this
> path...All that appears
> to be necessary in your case is adding -ltds to the
> LIBS line of the
> Makefile, to get dblib/ctlib working...I'm trying to
> see if I can dig up a
> solaris/86 box to sort out why the libtds objects
> are not being included
> in libsybdb.a and libct.a
>
> Brian
>
>
> On Fri, 27 Jul 2001, Joe wrote:
>
> > Does anyone know what type is in
> >
> > Unexpected column_type 37
> > Unexpected column_type 38
> > Unexpected column_type 52
> > Unexpected column_type 61
> >
> > I aready have STBVARCHAR and SYBINT4 just like in
> Unittests
> > below is the example
> > does anyone have the Case made up for the rest?
> >
> >
> > char *value_as_string(
> > TDSSOCKET *tds,
> > int col_idx)
> > {
> > static char result[256];
> > const int type =
> tds->res_info->columns[col_idx]->column_type;
> > const char *row =
> tds->res_info->current_row;
> > const int offset =
> tds->res_info->columns[col_idx]->column_offset;
> > const void *value = (row+offset);
> >
> > switch(type) {
> > case SYBVARCHAR:
> > strncpy(result, (char *)value,
> sizeof(result)-1);
> > result[sizeof(result)-1] = '\0';
> > break;
> > case SYBINT4:
> > sprintf(result, "%d", *(int *)value);
> > break;
> > default:
> > sprintf(result, "Unexpected column_type
> %d", type);
> > break;
> > }
> > return result;
> > }
> >
> >
> >
>
>
>
>
> ---
> You are currently subscribed to freetds as:
> [harfranks AT yahoo.com]
> To unsubscribe, forward this message to
$subst('Email.Unsub')


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




Archive powered by MHonArc 2.6.24.

Top of Page