Skip to Content.
Sympa Menu

freetds - Re: Example source codes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Carlos E. G. Carvalho" <cartola AT techmaster.com.br>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Example source codes
  • Date: Wed, 1 Sep 1999 19:13:03 -0300 (EST)


Ok, good question.

My situation is: I am working on a FreeBSD 3.2 using dblib from
freetds to access data in a MS SQL Server 6.5. The database I am accessing
has 85 tables with total 854 columns. So, from now I am having to access
only types like money, float, real, char, varchar, smallint and int. The
list of all the types is below. I need to know if I will be able to access
the fields like datetime, timestamp, text and image. To access float and
real I have already received information from this discussion list. May I
suppose I will be able to deal with datetime and timestamp like strings?
And money like float/real? Well, I will test this soon and if nobody
answers this I may send the experience to the list.

The types I have in the database:
binary
bit
datetime
float
identity
image
int
money
real
smallint
text
timestamp
tinyint
varchar

[]s,

Carlos E. G. Carvalho

On Mon, 30 Aug 1999, Brian Bruns wrote:

>
> Wow, thanks for the replies (I normally avoid text/image like the plague,
> but anyway...). I guess the question for Carlos is, what's your
> priorities? What are you trying to do with text/image, so we can make sure
> those things are first in the queue?
>
> Brian
>
> On Mon, 30 Aug 1999, Michael Peppler wrote:
>
> > Tom Poindexter writes:
> > > On Mon, Aug 30, 1999 at 03:41:20PM -0400, 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?)
> > >
> > > Sybtcl has text/image code if you're interested. The basic ideas come
> > > from Sybase sample code. DB-Lib require some specific coding steps,
> > along
> > > with mucking with text pointers and timestamps.
> >
> > Note that for retrieval you don't need to do anything special (at the
> > client level). For example, sybperl does:
> >
> > type = dbcoltype(dbproc, col);
> > len = dbdatlen(dbproc,col);
> > data = (BYTE *)dbdata(dbproc, col);
> >
> > and then simply copies the contents of 'data' for TEXT or IMAGE
> > datatypes.
> >
> > Client Library (and possibly DBlibrary's dbbind()) should convert
> > IMAGE datatypes to the hex string representation. TEXT datatypes
> > should be returned as is.
> >
> > Then in addition there are text/image functions, such as dbreadtext(),
> > dbmoretext(), dbwritetext(), ct_get_data(), ct_send_data() and maybe
> > one or two others.
> >
> > Michael
> > --
> > Michael Peppler -||- Data Migrations Inc.
> > mpeppler AT peppler.org -||- http://www.mbay.net/~mpeppler
> > Int. Sybase User Group -||- http://www.isug.com
> > Sybase on Linux mailing list: ase-linux-list AT isug.com
> >
> > ---
> > 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')
>





Archive powered by MHonArc 2.6.24.

Top of Page