Skip to Content.
Sympa Menu

freetds - varaddr parameter and column

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT franklin.oit.unc.edu>
  • Subject: varaddr parameter and column
  • Date: 13 Oct 2002 22:04:43 +0200


I started time ago coding dynamic query for use it on odbc.
But I stopped coding for problem with parameters.

Parameters seem similar to column info. They have a type, can be binded,
can contain same data (even blob) but work in different direction and
this give some problem.

Column are readed from wire to row buffer so client api can call tds to
retrieve values. Params are mostly written to wire so library should
write into buffer and then passed to tds that write on wire. But
information are stored in very differently mode.

For column into

TDSSOCKET -> TDSRESULTINFO* res_info -> current_row and columns

For parameters

TDSSOCKET -> TDSPARAMINFO *param_info
but also (why?)
TDSSOCKET -> dyns [cur_dyn_elem] -> TDSINPUTPARAM **params

But they contain very different information...
Why use params from dynamic instead of using param_info ?? Why they are
different ?
I know that every statement in ODBC can have is bindings but this is
true for result...

Simply I don't understand the right method for writing parameters into
tds and for read them...


Next part of mail is a big future change I intent to implement (in some
way, it can cause many problems, so is only design not coding for now)

It seem that varaddr is not very used in tds. It seem a repository for
client information. Old stuff still there? Perhaps tds should support
bindings? Many types are equal (byte speaking) from client to tdslib but
someone (the bastard numeric) are different. IMHO a method to support
direct binding in tds (writing directory to application) is to use
callback specified client routines (or null if type is the same). For
example if you want to write a numeric we just call a function
(registered in TDSCOLINFO) like writedata(void* data, int length) tds
call it with (&my_numeric,0), (0 mean fixed size, <0 for negative) for
writing numeric and lib translate numeric and write directly to
application. For blob/text tds can call function more time (just like a
file). Perhaps some other information (TDSSOCKET, TDSCOLINFO) are
useful.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page