Skip to Content.
Sympa Menu

freetds - Re: Example source codes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT umcc.ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Example source codes
  • Date: Mon, 30 Aug 1999 18:04:09 -0400 (EDT)



timestamp returns as a varbinary type (8 byte varbinary) and it does
indeed work, although I'm not really sure what good this does for the
frontend app (it returns as a hex number). Datetime does work, however
its been sometime since I last tested it. I'll revisit it tonight and make
sure everything works ok.

I'm in the process of cleaning up/expanding the example programs.
Specifically, I'd like to make tests for a wide variety for datatypes to
be used in regression testing. What's there now is just simple programs I
hack up to test one thing or another. Really, I'd like to have a 'make
test' like perl modules do, at least that's what I'm shooting for.

So, any submissions of code along these lines is appreciated.

brian

On Mon, 30 Aug 1999, Carlos E. G. Carvalho wrote:

> Hmm, looks very nice. What about datetime and timestamp? Am I able
> to access them as strings? I guess I have tried this in one test and as a
> result I didn't get the columns after the datetime one...
>
> Thanks again,
>
> []s,
>
> Carlos E. G. Carvalho
>
> On Mon, 30 Aug 1999, Brian Bruns wrote:
>
> >
> > Text and image types are likely to be a problem in dblib, the TDS layer
> > works ok, but dblib has no support for them. I'll see if I can look
> > into it this week. (Anyone have some dblib sample code using text/image to
> > play with?)
> >
> > Floats are fairly simple. Here is a code fragment to demonstrate it. Note:
> > there were some problems with earlier versions, it's probably best to grab
> > a recent snapshot of freetds.
> >
> > DBFLT8 flt;
> >
> > /* init stuff */
> >
> > dbcmd(dbproc,"select size from floater");
> > dbsqlexec(dbproc);
> > while (dbresults(dbproc)!=NO_MORE_RESULTS) {
> > dbbind(dbproc,1,FLT8BIND,-1,(BYTE *) &flt);
> > while (dbnextrow(dbproc)!=NO_MORE_ROWS)
> > printf("%6.3g\n",flt);
> > }
> >
> > /* clean up */
> >
> >
> > Reals work similarly but using the var type DBREAL and bind type REALBIND
> > instead of DBFLT8 and FLT8BIND respectively.
> >
> > On Mon, 30 Aug 1999, Carlos E. G. Carvalho wrote:
> >
> > > Hi, I am using dblib from freetds recently in a freebsd accessing
> > > a database in a MS SQL Server 6.5. I am having some dificulties in
> > > retriving some data types. Does anybody have some source code that uses
> > > dblib accessing data types like floats, image, text, etc, I mean, other
> > > than int and char (those that come with the tests in the unittest in
> > > dblib).
> > >
> > > Thanks, cheers,
> > >
> > > Carlos E. G. Carvalho
> > >
> > >
> > >
> > > ---
> > > You are currently subscribed to freetds as: camber AT ais.org
> > > To unsubscribe, forward this message to $subst('Email.Unsub')
> > >
> > >
> >
> >
> > ---
> > You are currently subscribed to freetds as: cartola AT techmaster.com.br
> > To unsubscribe, forward this message to $subst('Email.Unsub')
> >
>
>
> ---
> You are currently subscribed to freetds as: camber AT ais.org
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
>





Archive powered by MHonArc 2.6.24.

Top of Page