This is what currently happens
insert into junk values x'2000'
select * from junk
c1
----------
x'2000'
export to dumpfile.txt of del select hex(c1) from junk.
dumpfile.txt contains:
"2000"
load from dumpfile.txt of del replace into junk
select * from junk
c1
--------
x'32303030'
I need junk to c1 to be: x'2000'. Some kind of conversion during the
load process needs to happen to un-HEX the character string back to
binary.
For a more realistic scenario, need to unload data similar to:
ITEM_ID CONT_ID
-----------------------------
----------------------------------------------------------------
x'20060918142255954039000000' EWKN3TQ7M2J32Q1C
then edit the file substituting
"94+3+ICM8+icmnlsdb14+Srt_Transfer59+26+PCBB%24A4D CROTYHKX++++++++++18+PCBB%24A4DCROTYHKX++1+14+1043 "
for "EWKN3TQ7M2J32Q1C" , then reload the table from the new file.
Exporting the ITEM_ID field to a delimited file produces:
" ^F ^X^T""U^Õ@9","EWKN3TQ7M2J32Q1C" (with three trailing
null characters at the end of the first field)
Depending on the control characters in the field, utilities like grep,
sed, awk, etc. will do wild things. This is the reason it would be nice
to HEX the value as suggested (thus removing the control characters),
perform text substitution, then reload the table on the newly processed
file converting the HEXed value back to binary along the way to
preserve its original context.
Hope this clarifies.
Mike
Jan M. Nelken wrote:
>
Given the table created as:
D:\SQLLIB\BIN>db2 create table junk (c1 varchar(16) for bit data)
DB20000I The SQL command completed successfully.
you can insert hex value of 2000 into it:
D:\SQLLIB\BIN>db2 insert into junk values x'2000'
DB20000I The SQL command completed successfully.
which you can retrieve in two different ways:
D:\SQLLIB\BIN>db2 select * from junk
C1
-----------------------------------
x'2000'
1 record(s) selected.
D:\SQLLIB\BIN>db2 select hex(c1) from junk
1
--------------------------------
2000
1 record(s) selected.
If this is not what you want - then I don't understand your problem; please
elaborate.
Jan M. Nelkem