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 Go to next message
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 #465696 is a reply to message #465693] Thu, 15 July 2010 05:42 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Please copy and paste your sql session. Beacuse

rajugkgp wrote on Thu, 15 July 2010 05:29
I am seeing some trailing characters in the coloumn when we are inserting Blob. -R



We cant see what you are seeing on your screen.

[Updated on: Thu, 15 July 2010 05:45]

Report message to a moderator

Re: Getting trailing characters inserted for the blob data. [message #465698 is a reply to message #465696] Thu, 15 July 2010 06:03 Go to previous messageGo to next message
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 #465701 is a reply to message #465698] Thu, 15 July 2010 06:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And your programming language is?
And the programming interface with Oracle is?
And your code is?

Before posting, Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (for both server and client) with 4 decimals.

Regards
Michel
Re: Getting trailing characters inserted for the blob data. [message #465747 is a reply to message #465698] Thu, 15 July 2010 08:53 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
rajugkgp wrote on Thu, 15 July 2010 06:03
Sorry for the confusion


confusion is Still there , AS Michel Said Please copy and paste you sql seesion !!!!!!

btw I am looking at kernel32.dll what is that ???

[Updated on: Thu, 15 July 2010 08:54]

Report message to a moderator

Re: Getting trailing characters inserted for the blob data. [message #465748 is a reply to message #465701] Thu, 15 July 2010 08:56 Go to previous messageGo to next message
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 Go to previous message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
rajugkgp wrote on Thu, 15 July 2010 08:56
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.



Shocked Is this Oracle Code....This is Oracle Forum ...may be you want to go to C++ forum
Previous Topic: 11g pro*c appliation crashes while 10g is ok, why?
Next Topic: Unable to compile Pro C code with Oracle 11g in windows env
Goto Forum:
  


Current Time: Thu Mar 28 05:29:06 CDT 2024