Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / November 2004

Tip: Looking for answers? Try searching our database.

Binary values in the database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Poul M?ller Hansen - 29 Nov 2004 16:34 GMT
I'm struggling supporting national characters of different origin in a mixed
environment
using PHP, Perl and Java.

I have a database created with character set UTF-8, but I'm in doubt when
the data is stored
as UTF-8 or latin1-9 then the clients are also doing some automatic
character conversion.

For this reason I need a way to see how the data are stored in the database
without character
conversion.

Any way to see the binary/hexa decimal values ?

Thanks in advance,
Poul
Serge Rielau - 29 Nov 2004 17:52 GMT
Poul,

Just use the HEX function. It displays the data as-is. Works on pretty
much all data types.
Another thing you can do is CAST (c1 AS VARCHAR(100) FOR BIT DATA)
That will pass the data as-is to the client. (Works the other way around
on a parameter marker or host variable as well)

Cheers
Serge
Poul M?ller Hansen - 29 Nov 2004 18:46 GMT
> Another thing you can do is CAST (c1 AS VARCHAR(100) FOR BIT DATA)

Thanks, the hex function works fine.
Can you help me with a proper syntax to the "FOR BIT DATA" for this
statement ?
select name from pmh.test where no = 44

Cheers,
Poul
Serge Rielau - 29 Nov 2004 19:05 GMT
Poul Møller Hansen wrote:
> Thanks, the hex function works fine.
> Can you help me with a proper syntax to the "FOR BIT DATA" for this
> statement ?
> select name from pmh.test where no = 44

select cast(name as <typeofname> FOR BIT DATA) as name from pmh.test
where no = 44

Cheers
Serge
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.