473,386 Members | 1,754 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,386 software developers and data experts.

Problem with DB2 field type CHAR(n) FOR BIT DATA

Please help me.

I can see the content of field type CHAR(n) FOR BIT DATA of DB2
database, but when I try to see the content of mentioned field type by
using SQL query (ODBC connection) only I can see are some digits,
instead of appropriate characters.
Nov 12 '05 #1
5 21577
For bit data is binary data. You should not expect to see appropriate
characters, since that is not the intent of binary data. You are possibly
seeing hex values of the binary data.
Thanks
Aakash

"Ernez Catovic" <ca*****@bih.net.ba> wrote in message
news:ae*************************@posting.google.co m...
Please help me.

I can see the content of field type CHAR(n) FOR BIT DATA of DB2
database, but when I try to see the content of mentioned field type by
using SQL query (ODBC connection) only I can see are some digits,
instead of appropriate characters.

Nov 12 '05 #2
Depending on your version of DB2 (V8.1 GA I think)you can cast to
databse codepages:
CAST(c1 AS CHAR(n) FOR SBCS DATA)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #3
At first i thought it was one of those famous typos but you're right.
(nothing can beat the Onions anyway...)

Additional info :
db2 values cast('x' as varchar(20) for mixed data)
for non mixed. ie sbcs,dbcs,mbcs. (unicode)

Found about the topic in the imcompatibilities section but not in most
'cast' related doc sections.
Version 8 incompatibilities with previous releases on
http://publib.boulder.ibm.com/infoce...help/index.jsp

PM

"Serge Rielau" <sr*****@ca.eye-bee-m.com> a écrit dans le message de
news:bq**********@hanover.torolab.ibm.com...
Depending on your version of DB2 (V8.1 GA I think)you can cast to
databse codepages:
CAST(c1 AS CHAR(n) FOR SBCS DATA)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4
We stepped up to it after revamping the way how codepages got derived.
Prior to V8 expressions based on hostvars/parameter markers stayed in
client codepage until they "touched" something of the table (FOR BIT
DATA or DB-codepage). Then some really funky rules took hold to decide
who wins.
Now DB2 tranforms everything to DB codepage upon bindin unless it's
immediately assigned to FOR BIT DATA or CAST as such.
So we needed those casts. Being able to break that contagious FOR BIT
DATA property was a pleasant side-effect :-)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #5
if you have a table that contains some bit data as in "LONG VARCHAR FOR BIT DATA" and this stream of bit translates to a simple structure of data base attributes. Such as name, address, e-mail etc. Can you have a view on this table that will do the translation for you and give you the data in the translated data base attribute format instead of the stream of bits?
Jun 12 '06 #6

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

Similar topics

20
by: titi | last post by:
Question The road and traffic authority for a small country currently uses a system to store information about all 'currently' licensed drivers. A licensed driver has the following info stored...
1
by: Rajender | last post by:
I am getting the error: Invalid character value for cast specification In my xml file the date is like this: 2004-09-28T00:00:00.0000000-04:00 Because of the field eventdate which is...
3
by: Muhammad Farooq-i-Azam | last post by:
Hi, I am trying to define an arp structure but having problem doing so. I think I have define the correct arp structure but I find myself in a strange problem. The size of structure that I have...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
8
by: ctara_shafa | last post by:
Hi, I have a following problem: I'm creating a list and one of the fields should contain the date. Firstly I ask the user for the year, month and day and then I'd like to collect all this data in...
5
by: codergem | last post by:
Helo !!! I was trying to implement linked list in which the data field is Generic... the structure details are.. typedef struct node { void *data; struct node *next; }gnode;
6
by: marktxx | last post by:
Although the C90 standard only mentions the use of 'signed int' and 'unsigned int' for bit-fields (use 'int' at your own risk) and C99 adds _Bool. It seems that most compilers create the size of...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
27
by: Jeff | last post by:
Im trying to figure out why I cant read back a binary file correctly. I have the following union: #define BITE_RECORD_LEN 12 typedef union { unsigned char byte; struct { unsigned char type;...
1
by: elke | last post by:
Hi, I want to use an unmanaged dll in C# .net and I'm having some troubles witch a function that should return an array. I'm new at this, so I don't know what I'm doing wrong. Here is some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.