Skip to Content.
Sympa Menu

freetds - Re: Quick Question

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Ian Charnas" <icc AT po.cwru.edu>
  • To: freetds
  • Subject: Re: Quick Question
  • Date: Sat, 29 Jan 2000 10:21:50


Have you tried casting it to a string and running it through printf?
Something like...

if the data is characters,

/* Begin */
/* This might work if the data is characters. */
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);
strncpy(result, (char *)value, sizeof(result)-1);
result[sizeof(result)-1] = '\0';
printf("%s\n", result);
/* End */

Or, if the data is integer, as I suspect, then

/* Begin */
/* This might work if the data is characters. */
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);
sprintf(result, "%d", *(int *)value);
printf("%s\n", result);
/* End */


Hope this helps!

Ian Charnas.

On 01/27/00, ""Lefebvre, Michael" <mlefebvre AT websense.com>" wrote:
> How do I interpret a datatype of SYBDATETIMN
> returned by sqlserver?
>
> Thanks
> Mike Lefebvre
> mlefebvr AT websense.com
>
>
>
> -----Original Message-----
> From: James Cameron [mailto:james.cameron AT compaq.com]
> Sent: Wednesday, January 26, 2000 2:50 PM
> To: TDS Development Group
> Subject: [freetds] Re: Minor issues...
>
>
> Brian Bruns wrote:
> > There is a change that has to be made to run on alpha (by the way, from
> > my recollection alpha does not bus error on unaligned access but it is
> > simply slower than aligned access) [...]
>
> Since my company produced the Alpha I can tell you what actually happens
> ... the unaligned access is trapped, causes execution of trap code that
> will look at the instruction that failed, create a set of instructions
> on the fly that will do the same thing, and use them instead. ;-)
>
> Using the uac command, the user can change this to a fatal exception.
> This is usually done in coverage testing to find things that deserve
> being realigned for speed reasons.
>
> --
> James Cameron (cameron AT stl.dec.com)
>
> Not the Director of Titanic, but he had his name before I did.
>
> ---
> You are currently subscribed to freetds as: mlefebvre AT websense.com
> To unsubscribe, forward this message to
> $subst('Email.Unsub')



  • Quick Question, Lefebvre, Michael, 01/27/2000
    • <Possible follow-up(s)>
    • Re: Quick Question, Ian Charnas, 01/29/2000

Archive powered by MHonArc 2.6.24.

Top of Page