473,542 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 21613
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.ne t.ba> wrote in message
news:ae******** *************** **@posting.goog le.com...
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 imcompatibiliti es section but not in most
'cast' related doc sections.
Version 8 incompatibiliti es with previous releases on
http://publib.boulder.ibm.com/infoce...help/index.jsp

PM

"Serge Rielau" <sr*****@ca.e ye-bee-m.com> a écrit dans le message de
news:bq******** **@hanover.toro lab.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
marytaylor
1 New Member
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
2637
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 about them in a record; 1. Given name(s) of the license holder.(not more than 128 char (may have spaces)). 2. Surname of the license holder.(Not...
1
2405
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 dt:datetime in my xsd file. ******* MY XSD file <?xml version="1.0" ?>
3
2381
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 defined is 28 bytes, but it is reported to be 32 bytes by the sizeof() call. Interestingly, sum of individuals members of the sturcture is 28....
2
4432
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 */ #include <time.h>
8
539
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 one field. To do this I tried to concatenate those 3 numbers into one using strcat. A piece of code is as follows /*function to enter the date*/...
5
1998
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
3834
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 the bit-field object from the size used to specify the field. Could this be considered a defacto standard now (at least for 8 bit sized...
6
3512
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 to an old program that I wrote in delphi and it's a good opportunity to start with c++.
27
5066
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; /* 0 Type */ unsigned char sn; /* 1-3 Serial Number */
1
5781
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 code: #define USERINT_FUNC __cdecl #ifdef __cplusplus extern "C" { #endif
0
7392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5246
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
943
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.