Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Oracle question.


  • Please log in to reply

#1
bryan84

bryan84

    Member

  • Member
  • PipPip
  • 47 posts
I have this encrypt.sql...

Create or replace package cryptit is  
	   Function encrypt_data( p_data IN VARCHAR2 ) Return RAW DETERMINISTIC;  
	   Function decrypt_data( p_data IN RAW ) Return VARCHAR2 DETERMINISTIC;  
	 End cryptit;  
	 /  

Create or replace package body cryptit is  
V_Key	   RAW(128) := UTL_RAW.cast_to_raw('testkey1');
Function encrypt_data( p_data IN VARCHAR2 ) Return RAW DETERMINISTIC  
IS  
l_data RAW(2048) := utl_raw.cast_to_raw(p_data);  
l_encrypted RAW(2048);  
BEGIN  
NULL;  
l_encrypted := dbms_crypto.encrypt
( src => l_data,  
typ => DBMS_CRYPTO.DES_CBC_PKCS5,  
key => V_KEY );  
Return l_encrypted;  
END encrypt_data;  
Function decrypt_data( p_data IN RAW ) Return VARCHAR2 DETERMINISTIC  
IS  
l_decrypted RAW(2048);  
BEGIN  
l_decrypted := dbms_crypto.decrypt
( src => p_data,  
typ => DBMS_CRYPTO.DES_CBC_PKCS5,  
key => V_KEY );  
Return utl_raw.cast_to_varchar2(l_decrypted);  
END decrypt_data;  
End cryptit;  
/

But whenever I run it with my Bryan account that has been granted DBA privileges, I get an error:
Warning: Package Body created with compilation errors.

Yet if I run as a SYS, the above script work.

What can be round?
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP