[unixODBC-support] question about catalog functions and bound parameters

Eric Sharkey sharkey at netrics.com
Mon Feb 14 20:21:51 GMT 2005


> You can bind a parameter
> at almost any time but it is only used if there is a parameter marker
> in the SQL.

I see.  I was just coming to that conclusion.

> Did you mean bound column?

No, I meant bound parameter.

My driver is apparently doing the wrong thing.  It's looping over
the parameters defined in the APD and gathering up the data before
actually parsing the SQL.

If a parameter is bound to a valid buffer, it's usually not a big deal,
since it's just going to copy some extra data which will then be ignored
when the SQL is actually parsed.  However, if the length is
DATA_AT_EXEC, then the catalog function is returning SQL_NEED_DATA,
because the statement handle has a bound DATA_AT_EXEC parameter,
even though the statement being executed by the catalog function
doesn't have any parameters.

This problem isn't really specific to catalog functions at all,
as I'm getting the same error in quiktest.c when trying to execute
a parameterless select statement on a handle with two bound data-at-exec
parameters.

Thanks for your help.  That really clears things up.

Eric



More information about the unixODBC-support mailing list