View previous topic :: View next topic
|
Author |
Message |
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
Has anyone been able to insert values into a VARBIN DB2 column using rexx ?
I tried different options including enclosing the rexx host variable within bx'...'
When try to insert '1234567890123456FDABCAEA'X it chops off the first 2 bytes and adds binary zeroes at the end.
I have no clue what is going on
Is it even possible to do varbinary inserts using rexx or should I try to do this in Cobol ?
Code: |
/* rexx */
parse arg subsys creator
numeric digits 4096
pgpKey1 = '1234567890123456FDABCAEA'X
nonArmoredPGPKey = bx"'"pgpKey1"'"
keyType = 'N'
insertPGPKey = "insert into "creator".transmission_key",
" (key_non_armored, key_type)",
" values(?,?)"
|
Code: |
îÌ°::îÙ¿²
579135FACE00
680246DBAA00
|
|
|
Back to top |
|
|
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
After 70 bytes it just inserts binary zeroes
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
******************************** Top of Data ***********************************
îÌ°::îÙ¿²:ÍÈïäïèïáÈ:ï¿ò::îÌ°::îÙ¿²:ÍÈïäïèïáÈ:ï¿ò::îÌ°::îÙ¿²:ÍÈïäïèï
579135FACE277545554715AC13579135FACE277545554715AC13579135FACE277545550000000000
680246DBAA354737475437BD24680246DBAA354737475437BD24680246DBAA354737470000000000
------------------------------------------------------------------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------ |
[/quote] |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
What is the required format for the key value? What does the 'bx' prefix signify? Are you sure that the value is binary and not hex? |
|
Back to top |
|
|
harisukumaran
New User
Joined: 14 Jun 2005 Posts: 75
|
|
|
|
I was some how able to get it to work with the code below
Code: |
nonArmoredPGPKey = bx"'"c2x(pgpKey1)"'"
insertPGPKey = "insert into "creator".transmission_key",
" (key_id, key_non_armored, key_type)",
" values(?,(select varbinary("nonArmoredPGPKey",",
"4096) from sysibm.sysdummy1),?)" |
But I am not able to figure out how to get this to work when the varbin variable is parameterized |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
re bx"'"c2x(pgpKey1)'"' you could have done it simpler as
nonArmoredPGPKey = "BX'1234567890123456FDABCAEA'"
hence my question about required format. |
|
Back to top |
|
|
|