sql server - Get indicator value for unbound columns without calling SQLGetData() -


is there generic solution null/notnull status column without using sqlbindcol()?

for blob/memo columns in odbc result set, drivers provides limited support sqlgetdata() function. example:

if there 2 blob columns 3 , 4, data column 3 must read before reading 4. , after reading 4, it's not possible read 3.

so if abstraction layer provides resultset.column(4).isnull(), isnull() implementation must use sqlgetdata() check sql_null_data. after this, can't use resultset.column(3).read(buf) - or similar functions (okay, can read blobs/memo after sqlfetch() step step buffer avoid issues such buffering bad inside abstraction layer...).

one solution bind small buffer , sqllen value indiciator via sqlbindcol(). sqlfetch() return sql_null_data in sqllen indiciator value if value (blob, etc.) null, without need of calling sqlgetdata().

but drivers microsoft native client odbc driver can't use sqlgetdata() on bounded columns. if indicator non-null, it's not possible read data sqlgetdata().

the ms documentation says possible bind indiciator pointer via sqlbindcol , leave dataptr null. i've tried without success. indiciator gets never modified (initialized sql_null_data). i've tried set indicator pointer sqlsetdescfield() manually columns (inc desc rec counter, etc.) nothing changed. seems driver fills indicator ptr when data ptr available.

is there other method null/not null status columns?

since no 1 else has attempted answer i'll give this:

i don't believe there solution fits requirement stated think believe legitimate requirement perhaps misplaced.

just clear here talking sqlgetinfo driver replies sql_getdata_extensions specify whether columns may retrieved sqlgetdata out of order, in addition being bound or not , ms sql server odbc driver not allow out of order , not allow bound columns.

there plenty of wrappers in various languages around odbc , many of them have hit same problem. problem goes away if agree on 2 things 1) application should not select data not intend read 2) application should specify how of long column data wants , whether truncating data ok. once agree on ok read @ least of data.

for example, in perl, dbi has longreadlen , longtrunkok former specifies maximum amount of data read long column , latter says whether truncation allowable or not. if @ other languages odbc wrappers pretty same thing reason.

sorry if not answer looking for.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -