Posted By: fabrice Wrapped package not shown correctely - 06/20/22 11:01 AM
Hello,
if i try to see a wrapped package (ex SYS.DBMS_LOB), by right clicking on tree objects, i can't see the full code.

With this select command, we obtain more than one line :
select line, text from dba_source where type = 'PACKAGE BODY' and owner = 'SYS' and name = 'DBMS_LOB' order by line;

We see only the first one, by the tree objetcs.

Thanks
Wrapped code can indeed not be displayed.
Posted By: fabrice Re: Wrapped package not shown correctely - 06/21/22 08:46 AM
If you do a right click on SYS.DBMS_LOB, view spec and body, you can see package spec and truncate body.
The dody is display but truncated
SYS.DBMS_LOB is juste an example.
If you want to copy / past one package like this to an other database, you can't of course compile it because it's truncated.
Posted By: jhughes Re: Wrapped package not shown correctely - 06/21/22 01:42 PM
What are you trying to accomplish? Per Oracle documentation (https://docs.oracle.com/en/database/oracle/oracle-database/19/lnpls/plsql-source-text-wrapping.html)
"You can wrap the PL/SQL source text ..., thereby preventing anyone from displaying that text with the static data dictionary views *_SOURCE: "
This means you can't transfer a package that is wrapped from DB to DB simply by looking at the code in DBA_SOURCE. You need the original source code to compile the code again and that source code has to be stored external to the DB.
Posted By: fabrice Re: Wrapped package not shown correctely - 06/21/22 03:19 PM
You can wrap pl/sql code outside the database and transmit the result.
You can copy wrapped code and transfer it to another database.
You can try i you want.

Yoa cannot see the original code, of course, but it's not the problem
Posted By: jhughes Re: Wrapped package not shown correctely - 06/21/22 06:58 PM
I've not played around with wrapping but I do see the documentation refers to wrapping outside of the DB and distributing. That said, why are you trying to transfer internal Oracle code from DB to DB? That's something you rebuild on that server or fix via catproc.sql (never used it, just guessing).
Posted By: fabrice Re: Wrapped package not shown correctely - 06/22/22 07:25 AM
I do it because i need it,
If it's not possible with PSD to see a wrapped code not truncated, PSD should not show them in tree or show a warning message or something like that and threre is no probleme.
We can see code with dba_source so i thought PSD could...
Posted By: jhughes Re: Wrapped package not shown correctely - 06/22/22 01:25 PM
I would question what you see via *_SOURCE for Oracle supplied code in general. Again, you should not be transferring Oracle supplied code/objects from machine to machine in this manner. If this problem were to happen to user wrapped code, then I agree that Marco should look into it as a bug in PL/SQL Developer, but you've not yet identified such an issue.

All that said, if you are intent on going down the path you are on, you could always write some PL/SQL to read through *_SOURCE for your desired object, build it into a CLOB, output the clob and then transfer it yourself that way. Again, I highly doubt this will work for transferring Oracle supplied code/objects.
Posted By: fabrice Re: Wrapped package not shown correctely - 06/22/22 02:43 PM
it works.
© Allround Automations forums