× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 11-Jun-2014 11:57 -0500, Alan Shore wrote:

Before I forget, we are on V5r4

In STRSQL I can execute the following SQL statement
select hex('QUESTION')
FROM SYSIBM/SYSDUMMY1
And get the response of:
D8E4C5E2E3C9D6D5

I need to do the same thing on a field in an SQLRPG program
Here is the code snippet

exec sql SET OPTION COMMIT=*NONE, DATFMT=*ISO, CLOSQLCSR=*ENDMOD;
exec sql DISCONNECT ALL;
exec sql CONNECT RESET;
Exec Sql
Select Hex(binaryHMAC) into :SQLHexEquivalent
From SYSIBM/SYSDUMMY1;

And when I compile the program, this is the error
SQL0206 30 250 Position 38 Column BINARYHMAC not in specified tables.

As always - any and all responses gratefully accepted


Probably the desired request is either

SET :SQLHexEquivalent = HEX(:binaryHMAC) ;

or [improbably]

SET :SQLHexEquivalent = HEX('binaryHMAC') ;

P.S. What is with the CONNECTION stuff? Was that coded due to some difficulties [in the past, and so carried into new code], as some precautionary action, or is there some specific purpose served by explicitly effecting what would typically be default behavior of an implicit connection to *LOCAL?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.