This is a discussion on Problem with DB2 field type CHAR(n) FOR BIT DATA within the DB2 forums, part of the Database Server Software category; --> Please help me. I can see the content of field type CHAR(n) FOR BIT DATA of DB2 database, but ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| |||
| 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" <catovic@bih.net.ba> wrote in message news:ae5ced86.0312040935.915489b@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. |
| |||
| 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" <srielau@ca.eye-bee-m.com> a écrit dans le message de news:bqnvus$168$1@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 > |
| ||||
| 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 |