Can't see package body in SQL Developer version 3.1

Hello,
Have been scouring the boards and google for this issue for quite some time now. I think I have discovered the issue, but would like to see if a work around exists.
Problem:
I am unable to view packages, procs, VIEW DDl, etc. of other users. When a colleague of mine uses Toad, with the EXACT same connection ID and setting, they are in fact able to see all the source code...
What I've found:
Looking around, apparently Toad and SQL Dev work in different ways. Toad apparently uses DBA_SOURCE and DBA_OBJECTS to generate everything.
SQL Dev uses the META_DATA package to retrieve everything. Further, in order to use the meta_data package, I need the grant catalog role, or something like that.
Is there a way to set up SQL Developer to use the same method as Toad to retrieve the code? It's a fact that I WILL NOT receive the catalog permission per the DBAs... I can write out the
select text from DBA_SOURCE where OWNER = 'OWNER' and NAME = 'OBJECT NAME';
But, I would prefer to just be able to use the tree nodes and click on objects to generate all this. Anyone know of any setting for this?

Hi,
No doubt SQL Developer wants to be competitive with Toad but, in terms of raising red flags over inconsistencies in basic functionality, any difference versus SQL*Plus would be more surprising than versus Toad.
DBA_SOURCE and DBA_OBJECTS are public synonyms available in any standard Oracle installation, but you also need the SELECT ANY DICTIONARY privilege to get maximum benefit from them. That lets you view code in another user's schema without having an explicit privilege (like EXECUTE) on a package/procedure/function.
If you already do have such privileges (either SELECT ANY DICTIONARY, or EXECUTE or DEBUG on specific executable objects), and the Code tab is empty, then you will need to provide a test case, as Vadim indicates.
In terms of any case where SQL Developer utilizes DBMS_METADATA, my understanding is the API relies on the SELECT_CATALOG_ROLE privilege if a user does not own or otherwise have an explicitly granted privilege on an object. Developers like to use this API wherever possible in place of writing a script that might break or need maintenance to deal with future versions of the Oracle database.
I have no idea how Toad works, and I probably shouldn't speculate, but here is one scenario that could explain the case you mention without the connection user having any of the privileges noted above. Let's say the Toad client software calls a PL/SQL package that selects from DBA_SOURCE and is installed in a schema that has the SELECT ANY DICTIONARY privilege. All Toad users are granted EXECUTE on this package and therefore inherit SELECT ANY DICTIONARY in the context of running the package. This will work, but at the price of complicating installation of Toad. Also, it doesn't afford an administrator fine-grained control over metadata security.
Regards,
Gary
SQL Developer Team

Similar Messages

  • Can't see package body in SQL Developer version 2.1.1.64

    When I go to the object browser, I can see all of the package specs but can't seem to get to the package body. I can access the package body just fine through Toad, so I don't think it is an Oracle user issue. Help?

    I can see any user's Package Body when I'm logged into the database as a DBA, so it must be some privilege that you need. The privilege I would have guessed you need is SELECT ANY DICTIONARY but you say you have that privilege. If you were granted that privilege through a role, make sure that the role is active, or that it is a default role.
    Another role it might be looking for is EXECUTE ANY PROCEDURE, but I'm not sure. See if you can do these selects, since these are probably the views that SQL Developer is using:
    select * from dba_objects where owner = 'some owner' and object_type = 'PACKAGE BODY';
    select * from dba_source where owner = ' some owner' and type = 'PACKAGE BODY';Of course, if your database administrator is willing to grant you the DBA role, that ought to do the trick - works for me. Otherwise, you and your DBA may have to try different system privileges until you find the one that works.

  • Package Body from SQL Developer ?

    Team I am using SQL Developer Version 2.1.1.64 But I can not able to see the package body.
    Right click on the package provides an option to 'Save Package Spec and Body', but when I save it .. it only store the package spec ..
    Is it not possible to view the package body from SQL Developer ?
    Can anyone confirm ... how to get code of package body ... ?

    Hi Bipul,
    Although there might be people here using that specific tool, there is still the dedicated SQL Developer forum to ask in:
    SQL Developer
    Regards
    Peter

  • && Substitution Variable in Package Body using SQL Developer

    Hi Folks,
    I've moved over to working to in SQL Developer (its a very early version - 1.0.0) from a combination of SQL*Plus command line and a text editor. I'm trying to get this upgrgraded, but I think the question will be the same with a newer version anyway.
    I am creating a package, and in the package body I have some &&my_var substitutions that I was previoulsy prompted for when calling the .sql from the command line SQL*Plus. I need this as the variable needs to be different for the development and live environment.
    When working in SQL Developer, I can load the package body from Connection->Packages->My Package->My Package Body, and click the edit button to edit the code, however, when I click the Compile button in the top of the window my code error's because of the substituion variablle. An example is:
    CREATE OR REPLACE
    PACKAGE BODY MY_PACKAGE AS
    PROCEDURE MY_PROCEDURE
    BEGIN
    my_variable := &&my_function_from_live_or_dev_database
    END MY_PROCEDURE
    Can anyone tell me if there is a way of defining a compiler variable within the IDE widow while editing a package body stored in the database, without manually copying the code into the Worksheet and running it as a script?
    Thanks,
    AM

    953104 wrote:
    Thanks for the reply, the code was just quickly typed to show the sort of thing I am doing, it wasn't actual code form my project.
    I've come from a C background so what I would have done would be create a #define and changed to when on live or development - or passed the variable to the build environment from the IDE or makefiles and the change would have reflected through my whole project.
    What I want to be able to do is alter a definition of some sort that will reflect throughout my whole project, so I can change it in one location to minimize code changes before going live. I don't really want to be prompted at all. On one system it needs to be DEV_10 and on the other it needs to be LIVE_10.Is there a possibility to elimiante this difference at all?
    For example if DEV_10 is the oracle schemauser on the development database and LIVE_10 would be the one on the production system. THen you could just remove all references to the schema from your code.
    IF you are already connected to this schema, then you don't need to specify the schema name anymore.
    example
    instead of
    create or replace package dev_10.myPackage
    ...you can simply use
    create or replace package myPackage
    ...If needed you can alter the cuurently connected user just before you run the script.
    alter session set current_schema = LIVE10;
    create or replace package myPackage
    ...This would be a different working window in the developer (script worksheet, instead of direct pl/sql editor).
    Substitution variables are allowed there.

  • Issue with viewing Package Body in SQL Developer 2.1 EA1

    I was able to view the package body from different schemas after I log in with user account in SQL Developer 1.5.5.
    But with SQL Developer 2.1 EA1, I could view only spec and I can see the package body only if I log in with DBO account.
    Is there any setting that needs to be configured to be able to view the package body?
    Thanks!

    Thanks for replying my message.
    It's Oracle 9i.
    What I meant 'spec' is you can see only the headers you defined in spec. You can expend the package and be able to see the all functions and procedures but you won't be able to see the '%packagename% Body' where all the detail code were written.
    As I mentioned in my previous post, with SQL Developer 1.5.5 version, you can see spec and package body if you expend the package.

  • Issue with viewing Package Body  in SQL Developer 2.1 RC1

    Were anybody able to see the package body of other user in 2.1 RC1.
    I had an issue since 2.1 EA 1 so... just curious.
    - Oracle 9i
    - Windows XP SP3
    Please do let me know if there is any hint or setting that can be change to view the package body.
    Thanks!

    Thanks for your msg.
    Below is the info:
    1.
    SQL: SELECT * FROM v$version;
    Result:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    PL/SQL Release 9.2.0.8.0 - Production
    "CORE     9.2.0.8.0     Production"
    TNS for Solaris: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    2.
    Result:
    The account has 'EXECUTE' privilege on the package.
    3.
    SQL: SELECT username "User"
    ,granted_role "Granted_Role"
    ,initcap(admin_option) "Admin_Option"
    ,initcap(default_role) "Default_Role"
    FROM user_role_privs
    ORDER BY username
    ,granted_role;
    Result:
    User``````````Granted_Role```````````Admin_Option``Default_Role
    ~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~
    USER_NAME```SELECT_CATALOG_ROLE``No````````````Yes
    4.
    SQL:
    SELECT privilege "Privilege"
    ,initcap(admin_option) "Admin_Option"
    FROM user_sys_privs
    ORDER BY privilege;
    Result:
    Privilege````````````Admin_Option
    ~~~~~~ ~~~~~~~~~
    ALTER SESSION`````No
    CREATE SESSION````No
    CREATE SYNONYM```No

  • Can't see some body emails in "Gmail"

    In "Gmail", in some emails, I can't see the body of the email. This only happens in Firefox.
    In Internet Explorer and Chrome does not happen this problem.

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache. Note: This will temporarily log you out of all sites you're logged in to. To clear cache and cookies do the following:
    # Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    # Under "Time range to clear", select "Everything".
    # Now, click the arrow next to Details to toggle the Details list active.
    # From the details list, check Cache and Cookies and uncheck everything else.
    # Now click the Clear now button.
    Further information can be found in :
    [[Clear your cache, history and other personal information in Firefox]]
    If the above solution doesn't work you can try
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. Note: This will cause you to lose any Extensions (likely wont lose Kaspersky's addons), Open websites, and some Preferences.
    To Reset Firefox do the following:
    # Go to Firefox > Help > Troubleshooting Information.
    # Click the "Reset Firefox" button.
    # Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    # Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • SQL Developer version 1.0.0.15.57 Debugger problem

    I use SQL Developer create a package and debug the pl/sql code. I try to use SUBSTR function as below:
    temp VARCHAR2(32000);
    temp:= p_string; --parameter input
    temp := SUBSTR(temp, 2, LENGTH(temp));
    In debugger Watches panel LENGTH(temp) Value display ? no real value.
    Please help.
    Ted

    Hi Ted,
    I agree function calls should be evaluated. You can log an enhancement request on SQL Developer Exchange (and you'll get my vote).
    For the time being, use another temporary variable to hold the evaluation of the functions calls:
    temp2 := LENGTH(temp);
    temp := SUBSTR(temp, 2, temp2);
    Then watch temp2 instead LENGTH(temp).
    As for your specific problem, if you would have RTFM:
    - The third parameter of SUBSTR is optional: if you omit, all remaining characters will be returned. So no need for the SUBSTR here!
    - The third parameter of SUBSTR means length, not ending position. So temp := SUBSTR(temp, 2, LENGTH(temp)); will always fail, since you are 2 positions out of bounds.
    Regards,
    K.

  • I ther any SQL developer version for SunOS 5.10 (Unix)

    Is ther any SQL developer version for SunOS 5.10 (Unix). If it is available, please tell me from where it can be downloaded and how it can be installed?

    <p>You can use any of the downloads except the Mac or Linux ones.
    <p>We separated out the Windows downloads because that's the largest audience we have. So there are 2: one is the full install, and one which allows users to point SQL Developer to an existing, installed JDK. This means that you don't end up with duplicate or even multiple JDKs installed.You can download either of these. If you don't have the JDK installed, you might as well install the full build. The other thing about the full install is that it includes an early JDK release and many users prefer to use the latest JDK.
    <p>The entry for the "multiple platforms" is exactly the same build and code as the Windows without JDK. Both of these require you to download and install or already have a JDK installed.
    <p>I try to make this page clearer for each release. It seems I'm not there yet!
    <p>We certify on Windows, Linux and the Mac. There is a page detailing certification specifics see the home page of SQL Developer. We do not certify SunOS, but Unix platforms are supported. This means that you can use SQL Developer, but any issues you run into must be tested against a certified platform before we'll track the bugs.
    <p>Sue Harper</br>
    Product Manager

  • MS Access 2010 and Oracle SQL Developer Version 4.0.3.16 Error

    OS: Windows 7 Enterprise
    System Type: 64-bit Operating System
    I can not get MS Access 2010 to work/open with SQL Developer version 4.0.3.16.
    ERROR when testing connection to MS Access 2010
    "Status : Failure -Test failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
    I added the 32-bit ODBC data source for the MS Access I am trying to use with SQL Developer version 4.0.3.16 with the "C:\Windows\SysWOW64\odbcad32.exe" application, but I still get the same error.
    I appears that SQL Developer version 4.0.3.16.is looking at the 64-bit driver (ODBC Data Source) and I have no idea to direct SQL Developer version 4.0.3.16 to use the 32-bit driver (ODBC Data Source) when opening MS Access 2010.
    Thank you in advance for your advice.

    I downloaded the SQL Developer version 4.0.3.16 "sqldeveloper-4.0.3.16.84-x64.zip" that included the jre.
    How do I check which Java JDK I am running (32-bit versuns 64-bit)?
    In the command prompt I use "java -version" and I get this message "java is not recognized as an internal or external command"

  • SQL Worksheet fails to appear in Oracle SQL Developer Version 2.1

    I cannot open the SQL Worksheet in Oracle SQL Developer Version 2.1. When I select SQL Worksheet from the Tools menu, a box appears saying that the SQL Worksheet is opening, but nothing happens. After the first attempt, the box does not appear, but again nothing happens.

    Thats odd.
    Do you see any exceptions in console ? (to see the console launch sqldeveloper.exe in ../sqldeveloper/sqldeveloper/bin dir.)
    -Raghu

  • Japanese characters in SQL Developer  Version 1.5.4

    I am using SQL Developer ver 1.5.4 with Oracle 11g. There are Japanese characters stored in VARCHAR2 field.
    When I execute a SELECT SQL query, SQL Developer does not display Japanese characters in the Result window -- it displays row of small square characters instead.
    (When I execute the same query as a script -- it displays the Japanese characters in Script Output window,
    What should I do to have SQL Developer to display Japanese characters in Result window?
    Thank you!
    Mark.
    Edited by: MarcoPolo on Jul 7, 2009 11:16 AM

    Hi there, Have you fixed this issue?
    I'm having the same issue albeit with SQL Developer VERSION 1.5.5
    The Select stmt displays the the empty square boxes in the result window, I've set the encoding preferences to UTF8 in the menu and font to Arial Unicode (there is no option to set script to Japanese). How can i display japanese characters in the results window??
    When i export these empty square boxes in the result window to notepad (where encoding set to Unicode and Font set to Arial Unicode and Script to Japanese), the japanese value is displayed correctly in the notepad.
    Kindly provide some input
    Many Thanks

  • Oracle sql developer version 1.5.5.59 compatible with Windows 7 [64 bit]

    am currently using Oracle sql developer version 1.5.5.59, in some time my O.S. is going to migrate from WinXP to Windows 7 [64 bit] can anyone suggest me how to check/find whether Oracle version 1.5.5.59 need to be upgrade or not?

    Yes.
    Adobe - Photoshop CS5 Extended System Requirements

  • SQL Developer  Version 1.5.1 Build MAIN-5440 Imported Connections missing

    I have a problem using SQL Developer Version 1.5.1 Build MAIN-5440. I have successfully imported connections from my previous version of SQL Developer. After I restart, all the connections I have imported has been gone. I tried to import the connections but got an error message:
    java.lang.NullPointerException
         at oracle.jdeveloper.db.DatabaseConnections.getReferenceable(DatabaseConnections.java:695)
         at oracle.jdeveloper.db.DatabaseConnections.addConnection(DatabaseConnections.java:762)
         at oracle.dbtools.raptor.connections.ConnectionGrinder.doImportExport(ConnectionGrinder.java:243)
         at oracle.dbtools.raptor.connections.ConnectionGrinder.invoke(ConnectionGrinder.java:117)
         at oracle.dbtools.raptor.navigator.DatabaseNavigatorController.handleEvent(DatabaseNavigatorController.java:200)
         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:524)
         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:855)
         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:496)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    I tried to create a new connections. I can test the newly created connections but cannot save it.

    This bug was fixed in SqlDev 2.1.1. You'll find this build on our homepage.
    -Raghu

  • Unit Test exports between different SQL Developer versions

    Hi,
    I am having problems with trying to export and import unit test suites between SQL Developer versions. I can't find any documentation in this area. We have a number of unit test suites exported as XML files from version 2.1.1.64, and below are combinations of things I have tried:
    - I have tried to import a unit test suite into version 3.0.0.4 that was exported from version 2.1.1.64 and get the error "Import failed. unexpected null value". I expect that this is probably an unsupported action due to repository changes between the two versions - should I be able to do this?
    - I have upgraded the repository with unit tests in it. The unit tests run perfectly well in the upgraded repository. However, if I try to export any suites or individual tests, I get an error "Export failed.". A XML file is created but with what looks like only the header part of it.
    - I have created a new unit test suite in version 3.0.0.4 and this exports successfully.
    - I have gone into each test of a suite in the upgraded repository and made a change so that I can perform a commit. When I do an export, this does then work successfully.
    Therefore it appears that something is not carried out by default when the repository is upgraded, but this fixes itself if the test is amended and committed in the upgraded repository. Although this may be a workaround, we have 100's of tests and is not something I really want to do. Has anyone else experienced this and got any recommendations for this?
    Thanks, Pierre.

    Hi,
    I am having problems with trying to export and import unit test suites between SQL Developer versions. I can't find any documentation in this area. We have a number of unit test suites exported as XML files from version 2.1.1.64, and below are combinations of things I have tried:
    - I have tried to import a unit test suite into version 3.0.0.4 that was exported from version 2.1.1.64 and get the error "Import failed. unexpected null value". I expect that this is probably an unsupported action due to repository changes between the two versions - should I be able to do this?
    - I have upgraded the repository with unit tests in it. The unit tests run perfectly well in the upgraded repository. However, if I try to export any suites or individual tests, I get an error "Export failed.". A XML file is created but with what looks like only the header part of it.
    - I have created a new unit test suite in version 3.0.0.4 and this exports successfully.
    - I have gone into each test of a suite in the upgraded repository and made a change so that I can perform a commit. When I do an export, this does then work successfully.
    Therefore it appears that something is not carried out by default when the repository is upgraded, but this fixes itself if the test is amended and committed in the upgraded repository. Although this may be a workaround, we have 100's of tests and is not something I really want to do. Has anyone else experienced this and got any recommendations for this?
    Thanks, Pierre.

Maybe you are looking for

  • Need to remove first UsernameToken header on XML document using XSLT

    Can someone help me with an XSLT transformation where i want to remove the first wsse:Security header from my request message. I am not an XSLT expert, so i started playing around with XSLT code but no luck yet. My input message Before transformation

  • Pure xml flow in InDesign suggest pls...

    Hi everyone, we have pitched into the new xml workflow in InDesign. Basically it looks like Pearson ETM XML workflow followed in Quarkxpress. Please go through this sample pearson xml coding followed in quark: DUE TO PROBLEM IN POSTING WE HAVE CHANGE

  • Keyboard non-functioning - may have deleted something essential!

    Help! My keyboard has stopped working. Inexplicably, the mouse is fine, but nothing comes up when I type. I suspect that I may have deleted something essential. I was ruthlessly deleting things off my hard drive in an attempt to make iMovie and iDVD

  • SQL Server's FOR XML EXPLICIT functionality in Oracle

    What could be the best way to implement SQL Server's FOR XML EXPLICIT functionality? Can someone please give the overview?

  • Intercompany Accounting in Stock transfer/Sales

    Hello all I want to know what are the accounting entries generated in the following scenarios - 1. Intercompany Stock transfer 2. Intercompany Sales I know that we use the Intercompany Clearing G/L which we define in OBYA but am not sure how it is us