Dear all,
Is there any method to hide my package body? I do not want the users to get my source code from ALL_SOURCE table, thanks.

Use the wrap utility that Oracle provides to encrypt the package source. It should be in your oracle_home/bin directory. 

using wrap utility you will get the the .pll file. Which contains the codein hexadecimal format, when u compile this file instead of the .sql file, your code will be in hexa decimal format, so that you can't figure out the exact text from user_source.
wrap iname=inputfilename.sql oname=outfilename
all the best

Thanks for reply.
Actually in my environment, I can select the package (header) from all_source, but I can't find the package body. So I just wonder how the DBA does this.

Hi George,
I think that's because only the DBA has the privilege to view the source code. Your DBA has set the privilege of the user login so the user login can only view the header.


Find Wraped Source In Oracle...

Hi all,
how can i findout wraped function and procedure ... in oracle database
Gopinath M 
Hi Gopinath,
From your post I understand that you want to see the original non wrapped function or a procedure from its wrapped version.
As per my knowledge from a wrapped code we will not be able to generate the original version.
While creating a procedure or function if you wrap the code it will be stored in the wrapped format in the data dictionaries.
If you come to know of any other way to see the original code of a wrapped object please share it with me.
Code Wrap is to avoid others seeing / editing the source.
Hence if you are owner of the code you should save the source in normal sql file and then wrap it. Any changes required - base source should be changed and then wrap.
Oracle provide a function for security - why you need to break that? 
My question is to identify only wrapped procedure or any other wrapped
sources .no probs i got the solutions.

BLOB into Content Area

Is there a way to upload a file, that is in
a blok-column of a custom table, and put it
on a content area ?
Filip Huysmans. 
Do you want to move the file from the custom table to the content area?
You can use the content area APIs to add a file item, but you'll first have to write the file to the file system (it has to be visible to the add_item procedure).
Thanks Jerry,
But how do I write the file to the database ?
See my response to thread
Why isn't there an API for uploading a
file into the content area ?
I don't understand your question.
The add_item function will create a file item, but the file has to be uploaded from a file system that is visible to the API. There is no API call to load a file directly from another table.
The add_item function will create a file item in a content area, and upload the file. However, the file must reside on a file system that is visible to the procedure; i.e. on the same server as the database. There is no API that will copy a file stored in another database table.
If you want to load a file from a database table, you'll have to write it to the file system first.
I think that Filip meant why don't we have an API to directly upload a BLOB into the content area, passing a BLOB locator, rather than a filename to the API call. Doesn't that make sense?
For example, imagine that we dynamically generate a file/report, and store things temporary in a BLOB. We would like to store that BLOB in the content area.
We currently implemented the work around to write the BLOB in a temporary file and then upload that file (and then delete it...). But it is a bit awkward and a API with BLOB parameter would be handy.
I've got documents stored as blobs in a table and I would like to add them to my content area (using the api). So I first need to load them to the file server.
Can you please explain in more details how you implemented your workaround?
A solution to see documents stored as BLOB in a table directly in a content area could be to write a procedure that uses the package (pay attention 'cause it read only 32K at time!).
In Portal 3.0.9 there are two new functions that solve this problem:
add_item_post_upload and modify_item_post_upload (click on the links to see the documentation). These functions work by allowing you to first upload a document to the WWDOC_DOCUMENT$ table, and then creating/modifying a portal item to point to the document.
See the PL/SQL Gateway documention for more information on uploading files to the document table.
If you search this forum for "PL/SQL gateway", you'll find several examples and tips for using the gateway together with the post_upload procedure.
the same problem.
I intent to use add_item_post_upload function.
How insert a document(file.txt) in "WWDOC_DOCUMENT$"

Bulk load PDFs into database

I have a PL/SQL procedure that helps me to load PDFs (with fixed names) into a database table (in a BLOB column). I would like to run this procedure to upload all the PDFs by scanning through a directory (something like *.pdf). Is this possible? If so, could someone can help me to achieve this?
Any kind of help is appreciated.
to upload all the PDFs by scanning through a directory (something like *.pdf). Is this possible?If you mean to 'insert all PDF's into a BLOB column', yes, that should be possible.
However: mentioning your DB-version is very important here (always mention your version):
On 9i (or 8) you'd need some JAVA:
On 10g you could use DBMS_SCHEDULER to host OS commands or:
Upload blob by reading a directory
On 11gR2 there's the File Watcher: 
Since it's not easy to traverse a directory or set of directories in PL/SQL it may be easier to do either of the following:
1. Write a shell script that loops through the directory and passes the file name to SQL*Plus which will in turn invoke the necessary procedure to load it into the database.
2. Write a shell script that generates a list of filenames in a text file. This output file can be then opened and looped through in PL/SQL to load the PDFs in the database. 
No need of shell script.........
Load all your files in OS directory....-Ek...
Link this directory to alias directory on databse.....
use dbms_lob.loadfromfile package to load file with BLOB as datatype
create table
Hope this helps..........
user2361373 wrote:
No need of shell script.........
use dbms_lob.loadfromfile package to load file with BLOB as datatypeHow do you expect to get the list of files to the DBMS_LOB function? PL/SQL cannot loop through the contents of a directory. :)
That is why I made the suggestion to have a shell script do that work and pass the results onto the PL/SQL program. 
Thanks Heok. I will use your Java option to solve my problem.
On 9i (or 8) you'd need some JAVA:
Many thanks to Centinel and EK.
Edited by: Leo Rajan on Nov 17, 2009 10:16 AM

About wrap utility

I successfully wrap abc.sql to abc.plb .
After that, the file abc.plb is still readable using notepad. Is there anything wrong?
And also, how can compile abc.plb back into the database from which I dumped the source code?
Thanks a lot
After that, the file abc.plb is still readable using notepad. Is there anything wrong?Nothing worng with it,
just run the .plb script in your database and it will create the procedure with encrypted code.
Thanks a lot for your reply.
Now how can I prove to myself that the newly compiled stored function is encrypted?
the procedure that I did is as following:
type the function code in notepad and save it in operating system file. Then wrap it into .plb file. Then
create the function in Enterprise Manager by copying the wrapped version source code.
SELECT text FROM user_source where name = 'your_procedure_name';
You must see the text as garbage(encrypted).

Deleting a Text File in PL/SQL

I am using the utl_file package to read a text file one row at a
time into my PL/SQL program, I then manipulate data and output
my results to a 2nd text file.
I reuse the the output file and would therefore like to delete
the contence of the file before I start the procedure. Does
anybody know how to delete a text file within a PL/SQL procedure?
Thanks for you help 
HI ,
If you open file in write mode automoatically the contents
will delete . So no need to delete file and recreate .
Open in 'W' mode.
Is there any way to remove the file completely from the disk? 
The only way is by using java. Create a java class load to
database then create a function based on class and call theat
function where required. 
Thanks Vikas!
That pointed me in the right direction. Found this excellent
article which describes how to do this, in case someone else
runs into this problem...