[freetds] SP parameters
James K. Lowden
jklowden at freetds.org
Tue Jun 27 21:01:39 EDT 2006
Gustavo A. Gonzalez wrote:
> I think that the trouble is in load NULL parameter values with
> dbrpcparam, i dont know when pass 0 or -1 in datalen and maxlen
> parameters. Why it works fine on a 0.62.4 version of freetds and wont
> work on a 0.63 version?.
A lot of work has gone into parameter passing. It might have worked
"accidentally" before, or only with some servers. I don't remember. I
would expect the next version to be better, and in 0.65 (which is what
we're working on now) the db-lib functions all have tests at the beginning
to verify their inputs.
"If the value of the RPC parameter is NULL, pass datalen as 0, even if
type is a fixed-length datatype."
maxlen is used only to describe the buffer you've allocated for output
parameters. It tells db-lib not to write more than maxlen bytes to the
address you provide in the value argument. For input parameters (or to
defeat the length-check on output parameters) use -1.
> I dont understand how load it with DBRPCPARAM.
I hope it's clear now. Say if it's not. :-)
More information about the FreeTDS