wxDB and Blobs Issue, wxMSW 2.6.3
Amit
amitgupta.it at gmail.com
Fri Sep 29 04:08:06 PDT 2006
Hello all,
I am trying to retrieve blob data from database (Oracle). I am using
the test code to achieve this.
char* ptrBlob = new char[_STRSIZE] ;
long nErr = 0, nSize = 0;
ptrDb->GetData(ColIndex, SQL_C_BINARY, ptrBlob, _STRSIZE, &nSize);
if(nSize == SQL_NULL_DATA)
return NULL;
if(nSize <= _STRSIZE)
{
return ptrBlob;
}
char* ptrBuff = new char[nSize ];
strncpy(ptrBuff, ptrBlob, _STRSIZE);
delete ptrBlob;
if(ptrDb->GetData(ColIndex, SQL_C_BINARY, ptrBuff+_STRSIZE,
nSize -_STRSIZE, &nErr))
{
if (nErr != SQL_NULL_DATA)
{
return ptrBuff;
}
}
return NULL;
Using the above I am able to get the blob data, but not the whole of
it. According to my understanding the first call to GetData should give
me partial blob data and nSize variable should be set to size of blob
data.
On debugging I found that nSize variable does not respond to the actual
size of the blob.
May be, I am not doing the right way!
Thanks in advance.
Regards
-Amit
More information about the wx-users
mailing list