Send the check to David.

Jerry C. Adams
IBM i Programmer/Analyst
The truth? It's a much overrated thing. -Joseph Adams, Sr.
--
A&K Wholesale
Murfreesboro, TN
615-867-5070

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Friday, April 27, 2012 2:32 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: SQL encryption v5r4 error

Wow - very nice.

How do you guys know all this stuff?? Very impressive.

I found several articles on Iseries SQL encryption, but nothing about "for
bit data".

I have Conte's SQL/400 book and also Howard Arners - nothing about this
(probably because ENCRYPT wasn't supported when published no doubt).

The Iseries SQL error description didn't help much.

I feel like I should be paying tuition on this list!!



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Friday, April 27, 2012 1:56 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: SQL encryption v5r4 error

On 27 Apr 2012 11:12, Stone, Joel wrote:
Any ideas what is incorrect ?

SET ENCRYPTION PASSWORD 'AAABBB'
create table jstone/fl2 (field1 char(20)) insert into fl2 (field1)
values(Encrypt_RC2('TEST')) select decrypt_char(field1) from fl2
Argument 01 of function DECRYPT_CHAR not valid.

what doesn't SQL like here??

The DECRYPT_CHAR argument-01 requires the CHAR to have been defined as
FOR BIT DATA.

Try the following variation. An extra modification has the date\type
attributes in a field, instead of as derived from a literal\constant as
assigned by the SQL:

set encryption password 'AAABBB'
create table fl2
( field1 char(20)
, field2 char(40 /*20+16+4*/) FOR BIT DATA
)
insert into fl2 (field1) values('TEST')
update fl2 set field2=Encrypt_RC2(field1)
select field1, decrypt_char(field2) as field2 from fl2

Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


________________________________________________________________________
This inbound email has been scanned for all viruses by the MessageLabs
SkyScan
service.
________________________________________________________________________

______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].