473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to avoid codepage conversion?

Hi,
We have some DB2 table on the host that has varchar(3200) columns that
are used to store binary data (I know that "varchar(3200) for bit
data" should have been used, by modifying host table is not an option
at this time).
I wrote a Win32 application, which is using DB2 Connect and ODBC to
pull the data from the host. I am passing SQL_C_BINARY as a 3rd
parameter in SQLBindCol() call, ::SQLBindCol(hStmt, nColNo + 1,
SQL_C_BINARY, m_buffer, sizeof(m_buffer), &m_nLen) and am getting data
as it is stored in the database (no codepage conversion). Great!!!
But! Unfortunately, there is a but. This solution works only when I
connect directly from PC to the host. When the connection is
established through the gateway server, the gateway does perform the
codepage conversion. I tried to do
select cast(data as varchar(3200) for bit data) from table, but DB2
complains about it. Select cast (data as blob) from table, solved
conversion problem, but made queries much, much slower.
Is there any other ways to solve this problem? Is it possible to
detect programmatically if connection is establish via gateway or
directly to the host?
Regards,
-- Vladimir
Nov 12 '05 #1
1 3900
Although you say it isn't an option - correcting the column definition is,
in fact, your only option.

The lack of conversion in the direct case is a known problem, and has been
corrected in V8.

The connect will
"Vladimir Khvostov" <vl******@khvostov.com> wrote in message
news:6c**************************@posting.google.c om...
Hi,
We have some DB2 table on the host that has varchar(3200) columns that
are used to store binary data (I know that "varchar(3200) for bit
data" should have been used, by modifying host table is not an option
at this time).
I wrote a Win32 application, which is using DB2 Connect and ODBC to
pull the data from the host. I am passing SQL_C_BINARY as a 3rd
parameter in SQLBindCol() call, ::SQLBindCol(hStmt, nColNo + 1,
SQL_C_BINARY, m_buffer, sizeof(m_buffer), &m_nLen) and am getting data
as it is stored in the database (no codepage conversion). Great!!!
But! Unfortunately, there is a but. This solution works only when I
connect directly from PC to the host. When the connection is
established through the gateway server, the gateway does perform the
codepage conversion. I tried to do
select cast(data as varchar(3200) for bit data) from table, but DB2
complains about it. Select cast (data as blob) from table, solved
conversion problem, but made queries much, much slower.
Is there any other ways to solve this problem? Is it possible to
detect programmatically if connection is establish via gateway or
directly to the host?
Regards,
-- Vladimir

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Christopher H. Laco | last post by:
Long story longer. I need to get web user input into a backend system that a) only grocks single byte encoding, b) expectes the data transer to be 1 bytes = 1 character, and c) uses the HP Roman-6...
8
by: Kim Bundgaard | last post by:
Hi Anyone know where I can look for problem with codepage conversion between DB2 UDB Connect EE V8.2 (fixpak 3) and DB2 UDB z/OS V7. With DB2 UDB Connect EE V7.2 (fixpak 7) i get Ebcdic X'5A'...
1
by: Philip M. Fleischmann | last post by:
Hi, i have to convert raw MSDOS-OEM-character set text files (codepage 430) to standard windows ANSI character set for file I/O in C# (batch conversion). Can anyone help me how this can be...
4
by: Ram | last post by:
Dear All, Good Day I am trying to convert a file which is generated on AS400 with codepage 00420 (arabic & English data combination) with no success. But using the same code( and changing 20420...
2
by: bvijai | last post by:
Hi, I am facing a problem whle importing the DEL files ( encoding: Unicode) into a Unicode database.The DEL files have French Characters.I observed that the French Character é has been converted...
6
by: msdnuniv | last post by:
Hello everybody, since days i try to convert Unicode-Strings in VB.NET to ANSI which should be processable in VB6 and converted to unicode again. It should be possible with any codepage, e.g....
7
by: Amber | last post by:
We use the IBM OLE DB Provider for DB2 to connect to a database on AIX 5.2 from SQL Server Integration Service. But there is some codepage problems. On AIX we use ISO-8859-1, when use DB2 CLP, we...
0
by: pike | last post by:
I have data (cp500) which I want to read with a windows client. Can anyone tell me what codepage to use on the client side?
0
by: SAM689532 | last post by:
I have DB2 v7.1.2 on IBM Z/OS and DB2 V8.1.0.36 Level ID 01010106 Build Level s021023 with JDK 1.3.1 on my Windows platform. I am trying to load some Arabic character data to our mainframe ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.