This discussion is archived
4 Replies Latest reply: Jan 17, 2013 5:26 PM by 982820 RSS

How to wrap a package body in the Oracle Cloud

982820 Newbie
Currently Being Moderated
Does anyone know if it is possible to wrap a PL/SQL package body in the Oracle Cloud? I tried to wrap it on my local machine and then upload it but when I ran it, it said the wrapped package was corrupt. DBMS_DDL is a lot of extra work and only works for packages <= 32K. Is there any other way to do this?

Maybe in the SQL Workshop, upload script section, there could be an option to wrap code when you run it?

Thanks,

Steve
  • 1. Re: How to wrap a package body in the Oracle Cloud
    RickG Explorer
    Currently Being Moderated
    Steve -

    i am fairly certain you cannot use the wrap uitility in the Database Cloud, as that is stored in the file system and you do not have access to the file system in the Cloud. When you say you uploaded the wrapped package, did you use the SQL Script utility in Application Express, or something else? That would be my guess as to what would work, but I have not tried it.

    Let me know.

    - Rick Greenwald
  • 2. Re: How to wrap a package body in the Oracle Cloud
    982820 Newbie
    Currently Being Moderated
    Rick,

    Thanks for the quick response. I used the SQL Workshop, script upload function (in Apex) to upload a package that I wrapped on my pc (Windows 7) using the wrap command line utility (11g). It uploaded fine but when I tried to run it, it returned a message like "Wrapped code is invalid or corrupted". This was not what I would have expected since I know you can import/export wrapped code between systems (different OS) without issue. Perhaps the command line wrap is OS specific and the import/export is doing some kind of translation?

    Anyway, I know you cannot use the command line option directly in the cloud because, as you say, you don't have access to the command line. DBMS_DDL is too tedious to use and has the 32K limit and unfortunately, there is no command like, "Alter package body xxx compile wrapped". So that leaves using the SQL Developer Cart option to move wrapped code from a local db to the cloud db. Unfortunately, I'm still having roles and permissions issues with my account which Oracle Support hasn't been able to fix over the last few weeks so I can't try this option (or even login using SQL Dev). Has anyone tried to do this? Does anyone know of another way to do this that I'm not thinking of?

    Thanks,

    Steve
  • 3. Re: How to wrap a package body in the Oracle Cloud
    RodWest Guru
    Currently Being Moderated
    Hi,

    You do not have access to the wrap utility or the DBMS_DDL package within the DBCS, so I don't see anyway to wrap the packages once you are in the cloud.

    It doesn't surprise me that the SQL Workbench script import from windows 7 does not work for wrapped packages as the windows character set is different.

    However, you can import wrapped packages using the SQL Developer cart and they work fine in the DBCS. The connection instructions for SQL Developer are not very clear. You need to create an Apex user and put this user into the SQL Developer, RESTful Services, OAuth2 Client Developer user groups and then use this user in the cloud connection.

    Rod West
  • 4. Re: How to wrap a package body in the Oracle Cloud
    982820 Newbie
    Currently Being Moderated
    Rod,

    Thanks for the clarification that the wrap issue is one of character set conversion. I had a feeling this was the case.

    As for the SQL Developer login. I tried what you suggested. When I try to login, I get the message, "Invalid Resource Owner Credentials." The user has the three roles granted but it still doesn't work.

    Besides this issue, I have been working with tech support for the last two weeks on another related issue. I cannot see any users in the Identity console (except myself) and thus cannot reset the sftp user password (or use the sftp function at all). Tech support said I was missing the necessary roles and was not correctly created as the admin user for the database service. They granted the roles but still nothing works any better. My trial runs out on Jan 26th so I don't think this will get resolved. I may try to sign up again under a different user unless someone else has any way of fixing this.

    Regards,

    Steve

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points