Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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