Here is the code, simplified somewhat.

This is the INSERT.  The a_alien_last_name goes into a RAW (56bytes) field.  It 
used to go into a VARCHAR.  Following this is the ENCRYPT_COLUMN function in 
Oracle that is called in the INSERT.

<CFSET a_alien_last_name = ''>
<cfquery name="qInsertF9099AlienInfo" datasource="#application.dbDataSource#">  
                
    INSERT INTO F9089_ALIEN_INFO (
        F9089_id,
        alien_last_name
)
VALUES  (
    <cfqueryparam cfsqltype="cf_sql_INTEGER" 
    value="#arguments.inStruct.l_F9099_id#">,   
    Encrypt_Column(RPAD(UPPER(NVL(<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#a_alien_last_name#">,' ')),56,' '),'CFASJAAAEPTSKEJPI')) 
</cfquery>



encrypt_column in Oracle:

CREATE OR REPLACE function encrypt_column (input_string in varchar2, key_string 
in varchar2) return raw is encrypted_string  RAW(2048);
begin
   if input_string is NULL then
   return NULL;
   else
   encrypted_string:=dbms_obfuscation_toolkit.DES3Encrypt(input => 
UTL_RAW.CAST_TO_RAW(input_string),
   key => UTL_RAW.CAST_TO_RAW(key_string));
   return (encrypted_string);
   end if;
end;


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358674
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to