Hello Snorri,
I think you will have to use a temporary table for the load of the data.
Here a small test that works:
set encryption password "Kalu knows the solution";
unload to /tmp/kalu_test
select customer_num, lname, fname, encrypt_aes(fname)
from customer;
drop table if exists customer_enc;
create temp table customer_enc(
customer_num int,
lname varchar(128),
fname varchar(128),
fname_enc varchar(128)
) with no log;
drop table if exists customer2;
create table customer2(
customer_num int,
lname varchar(128),
fname varchar(128)
);
load from /tmp/kalu_test
insert into customer_enc;
insert into customer2
select customer_num, lname, decrypt_char(fname_enc,"Kalu knows the solution") from customer_enc;
select * from customer2;
------------------------------
Gerd Kaluzinski
------------------------------