Print Thread
Wrapped package not shown correctely
#64012 06/20/22 11:01 AM
Joined: Nov 2016
Posts: 72
F
fabrice Offline OP
Member
OP Offline
Member
F
Joined: Nov 2016
Posts: 72
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

Last edited by fabrice; 06/20/22 11:48 AM.
Re: Wrapped package not shown correctely
fabrice #64016 06/21/22 08:13 AM
Joined: Aug 1999
Posts: 21,665
Member
Offline
Member
Joined: Aug 1999
Posts: 21,665
Wrapped code can indeed not be displayed.


Marco Kalter
Allround Automations
Re: Wrapped package not shown correctely
fabrice #64017 06/21/22 08:46 AM
Joined: Nov 2016
Posts: 72
F
fabrice Offline OP
Member
OP Offline
Member
F
Joined: Nov 2016
Posts: 72
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.

Re: Wrapped package not shown correctely
fabrice #64018 06/21/22 01:42 PM
Joined: Jan 2006
Posts: 30
J
Member
Offline
Member
J
Joined: Jan 2006
Posts: 30
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.

Re: Wrapped package not shown correctely
fabrice #64019 06/21/22 03:19 PM
Joined: Nov 2016
Posts: 72
F
fabrice Offline OP
Member
OP Offline
Member
F
Joined: Nov 2016
Posts: 72
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

Last edited by fabrice; 06/21/22 03:20 PM.
Re: Wrapped package not shown correctely
fabrice #64021 06/21/22 06:58 PM
Joined: Jan 2006
Posts: 30
J
Member
Offline
Member
J
Joined: Jan 2006
Posts: 30
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).

Re: Wrapped package not shown correctely
fabrice #64022 06/22/22 07:25 AM
Joined: Nov 2016
Posts: 72
F
fabrice Offline OP
Member
OP Offline
Member
F
Joined: Nov 2016
Posts: 72
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...

Last edited by fabrice; 06/22/22 07:30 AM.
Re: Wrapped package not shown correctely
fabrice #64024 06/22/22 01:25 PM
Joined: Jan 2006
Posts: 30
J
Member
Offline
Member
J
Joined: Jan 2006
Posts: 30
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.

Re: Wrapped package not shown correctely
fabrice #64028 06/22/22 02:43 PM
Joined: Nov 2016
Posts: 72
F
fabrice Offline OP
Member
OP Offline
Member
F
Joined: Nov 2016
Posts: 72
it works.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4