From: tuanglen@hotmail.com (Tuan)
Newsgroups: comp.databases.oracle.misc
Subject: Entering and reading varchar in HEX
Date: 8 Aug 2001 20:41:38 -0700
Organization: http://groups.google.com/
Lines: 42
Message-ID: <df045d93.0108081941.1b057a80@posting.google.com>
NNTP-Posting-Host: 207.88.159.46
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 997328498 20460 127.0.0.1 (9 Aug 2001 03:41:38 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 9 Aug 2001 03:41:38 GMT


Apologies for my very limited knowledge of Oracle.
Internationalization is my specialty, but I need to know this part
when I work with real DBAs.

When building a system that uses Oracle 8i, I want to be able to
directly insert known bytes into a varchar and directly view the bytes
in a varchar without having to bother with visible characters, so that
I can debug international systems from anywhere with any setup.

I want to get below the abstraction of the text entry and rendering
systems of the intermediate software systems and work directly with
the bytes in the database.

For example, there are certain Japanese characters or Korean
characters that I can read and write directly in hex in several
different text encodings. If I'm working with a DBA, and he's running
some version of SQL-plus on on some Solaris box, probably in a US
locale, via a Foo-brand terminal emulator on some Macintosh
laptop...how do I enter Japanese text into a varchar in the database?
He's not likely to have Japanese support on his Mac, but even if he
does, it won't survive the passage thru most terminal emulators, unix
utilities, etc.

Forget it. I know the actual bytes I need, so now all I need to know
is what SQL to type to enter those bytes directly in hex into the
varchar.

On the flip side, suppose I enter some Chinese into a Web form that is
supposed to pass it thru a long chain of systems, ultimately landing
in a varchar in the database. Now, I want to see what's in that
varchar using some terminal emulator that couldn't possibly display
Chinese. I wouldn't trust it anyway. I want to see what actual bytes
just got deposited, displayed in hex, not text.

Custom functions won't help me much. I need something I can count on
being there on every Oracle 8i installation.

What's the simplest SQL expression for "insert C3B1 into <some
varchar>" and the simplest SQL expression that would output "C3B1"
from some varchar if that's what it contained?

Thanks.

