Thanks. That works. Strange that the STRSQL does not require the casting to work.

"CRPence" <CRPbottle@xxxxxxxxx> wrote in message news:<mailman.1931.1354221121.10847.midrange-l@xxxxxxxxxxxx>...
On 29 Nov 2012 13:14, Lim Hock-Chai wrote:
Below is the error that I'm getting when run it thru RUNSQLSTM:

5770SS1 V7R1M0 100423 Run SQL Statements SVLRSPTST
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
10 create or replace variable palhc.pinewEncPwd Binary(256) default 'TEST124 ';

SQL0303 30 10 Position 1 Variable PINEWENCPWD not compatible
or value too long.

I have never really fully understood the nuances for making
/character/ and /binary/ typed data compatible for the SQL, but the
easiest solution is to CAST the literal explicitly to the desired type.
I thought another option was to specify the literal in hex notation,
e.g. x'E3C5E2E3F1F2F44040', but on v5r3 that resulted in an SQL0408 for

Try the following for the value to assign-to the variable:

cast( 'TEST124 ' as binary(256) )
-- just BINARY ¿should be sufficient?, but all bad on v5r3 :-(
-- it deposited only the 'T'. For proper 0x00 pad, one might
-- expect cast('TEST124 ' as binary(9)) is more appropriate
-- or required, but the cast to BINARY pads properly IME

Regards, Chuck

This thread ...

Return to Archive home page | Return to MIDRANGE.COM home page