[freetds] obtaining statement type information
ZIGLIO, Frediano, VF-IT
Frediano.Ziglio at vodafone.com
Tue Apr 20 06:23:17 EDT 2004
> It looks to me like if you have a statement handle,
> calling SQLGetDiagField with an argument of
> SQL_DIAG_DYNAMIC_FUNCTION_CODE is the ODBC way to find out
> what kind of statement it is (insert, select, update, etc...)
> Question 1 - is that right?
> It looks like freetds 0.62.3 does not implement this function
> currently, there's a TODO marker there.
> Question 2 - is that right?
Yes and not. It returns an empty string, that is an unknown statement.
Drivers are not required to support this option, they can return
> I very much would like to be able to determine this information,
> if possible after a statement is prepared, and before it is executed
> (this is how I do it in the OCI application that I'm porting)
> Question 3 - is this possible in any way with freetds?
Not currently under FreeTDS and is implementable only using mssql7+ (not
Sybase, not mssql < 7). Not that difficult to code but not so important
> Thanks for any tips.
More information about the FreeTDS