473,804 Members | 2,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binary values in the database

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
Nov 12 '05 #1
3 1893
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
Nov 12 '05 #2
> 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
Nov 12 '05 #3
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
Nov 12 '05 #4

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

Similar topics

1
2322
by: Johannes | last post by:
Hi, I tried to pack eight integer values and one string into one binary string, which I would like to store in a mysql db. I encountered two problems doing this: 1) $this->packed = pack('N8A*', $this->value1, $this->value2, $this->value3, $this->value4, $this->value5, $this->value6, $this->value7, $this->value8, $this->stringvalue);
2
1469
by: Nicholas Sherlock | last post by:
Hey all, I'm tearing my hair out over this one.. I'm using EasyPHP, and trying to write a script which receives binary POST data from a client program of mine. I've put together a simplified example which demonstrates the problem. The data looks like this: (String showing the length of the following binary)(Character #10)(Binary data)
3
5598
by: David Stockwell | last post by:
Hi, I'd like to read the contents of a file into memory. The problem is that this file is binary. I then want to store the whole thing in memory to a database as a blob. I have no problem reading from a file: I did this: import os f = open('/bin/ls' , 'r+b') data = f.read()
4
9906
by: Hazzard | last post by:
What is the best way to do this? Binary with 0 representing off and 1 on? Int16 with 1 representing first button, 2 the second, 3 ... varchar with a character values at certain positions in the string representing radio button values. Thanks, -hazz
6
1555
by: james | last post by:
I will try to make this short and to the point. I am reading values from a file using a Binary Reader. At a particular address I can get a value of , Hex 10 or Hex 01 . (varies can be 30, 20, 02,03 etc.) I need to keep those values as shown..........10 or 01. And then split the value........ for instance the 10 becomes 1 or 0. (extract either the 1 or the 0 and display it) Or in the case of the 01,,,,,,,,,,,0 or 1.( extract either the 0...
3
8518
by: Me Alone | last post by:
Hello: I am trying to edit some C code I found in "The definitive guide to using, programming, and administering MySQL" by Paul DuBois. This C client program connects and then segfaults when the function load_image is called. Would anyone be able to point me to what I might be doing wrong? Thanks in advance, C Newbie
0
1356
by: zw | last post by:
Hi I have problems displaying binary values on cells on the GUI. The program crashed with following dialog box: "The following exception occurred in the DataGridView: System.ArgumentException: Parameter is not valid at System.Drawing.Image.FromStream(... at System.Drawing.ImageConverter.ConvertFrom(... at System.Windows.Forms.Formatter.FormatObjectInternal(...
4
7245
by: =?ISO-8859-1?Q?Hans_M=FCller?= | last post by:
Good morning folks, I cannot read a binary file into a mysql database. Everything I tried did not succeed. What I tried (found from various google lookups...) is this: con = MySQLdb.connect(to server) cur = con.cursor() cur.execute("insert into data values('file1', %s)", (open("test.jpg", "rb").read(), ))
8
1948
by: Bryan.Fodness | last post by:
Hello, I am having trouble writing the code to read a binary string. I would like to extract the values for use in a calculation. Any help would be great. Here is my function that takes in a string. def parseSequence(data, start):
5
3744
by: embza | last post by:
currently i have developed a C# application that makes ready structured variables holding binary values to be written into oracle database. The values to be inserted are different. some of them are as small as 1bit, 2bits, 3bit ....8bit, 2bytes, and the others are as large as 8,000 bytes and some may be 4Gigs larger. what data types should I use to store these values in my oracle10g database tables. Considering all the values are to be used...
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10069
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
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

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.