Home » Developer & Programmer » Precompilers, OCI & OCCI » Getting trailing characters inserted for the blob data. (Oracle 11g client running on Windows 2008 Server 64bit.)
Getting trailing characters inserted for the blob data. [message #465693] |
Thu, 15 July 2010 05:29  |
rajugkgp
Messages: 3 Registered: July 2010
|
Junior Member |
|
|
Dear All,
I am seeing some trailing characters in the coloumn when we are inserting Blob. I am doing SQLBindParameter with SQL_C_BINARY and SQL_LONGVARBINARY as InputOutputType and ValueType respectively.Do you see any problem in this.
I get this problem when I am running Oracle 11 g client on an Windows 2008 Server 64bit.When the same set of query is fired from Windows 2003 Server 32bit with Oracle 10g it works fine and no trailing character gets inserted.
Thanks in advance.
-R
|
|
|
|
Re: Getting trailing characters inserted for the blob data. [message #465698 is a reply to message #465696] |
Thu, 15 July 2010 06:03   |
rajugkgp
Messages: 3 Registered: July 2010
|
Junior Member |
|
|
Sorry for the confusion it come as like this
ntdll.dll!KiFastSystemCallRet 0x7c8285ec
kernel32.dll + 0x24ed (0x77e424ed)
termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾ Þï¾
When I try to retrieve the data from the pl/sql backend.
|
|
|
|
|
Re: Getting trailing characters inserted for the blob data. [message #465748 is a reply to message #465701] |
Thu, 15 July 2010 08:56   |
rajugkgp
Messages: 3 Registered: July 2010
|
Junior Member |
|
|
Below I have given the code snippets by which I am executing.
SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
elementSize, 0, this->keyElementValues,
elementSize, &lsqlkeyElementValueLengths);
SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
Here the this->keyElementValues is of void pointer.
When I query on the back ground I get the below garbage value.It is written in C++.
the void value is being taken like this
void *valuePtr = (void *)((long) this->keyElementValues + (index * elementSize));
where index is present in a for loop and the bytes are copied in memcpy(valuePtr, data, bytesToCopy);
I am not sure whether this casting would work correctly when I am moving from 32bit to 64bit.
|
|
|
Re: Getting trailing characters inserted for the blob data. [message #465769 is a reply to message #465748] |
Thu, 15 July 2010 09:41  |
 |
rahulvb
Messages: 924 Registered: October 2009 Location: Somewhere Near Equator.
|
Senior Member |
|
|
rajugkgp wrote on Thu, 15 July 2010 08:56Below I have given the code snippets by which I am executing.
SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
elementSize, 0, this->keyElementValues,
elementSize, &lsqlkeyElementValueLengths);
SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
Here the this->keyElementValues is of void pointer.
When I query on the back ground I get the below garbage value.It is written in C++.
the void value is being taken like this
void *valuePtr = (void *)((long) this->keyElementValues + (index * elementSize));
where index is present in a for loop and the bytes are copied in memcpy(valuePtr, data, bytesToCopy);
I am not sure whether this casting would work correctly when I am moving from 32bit to 64bit.
Is this Oracle Code....This is Oracle Forum ...may be you want to go to C++ forum
|
|
|
Goto Forum:
Current Time: Mon Mar 31 11:17:09 CDT 2025
|