Edit package body from sqlplus

HI,
I usually use SQL developer to create and edit my packages which usually worked fine. But the problem for today is that I can not save only packageA's body, and the others can be saved well. ( the SQL developer just runs for ever when I click save)
And I try to edit it using sqlplus, but I don't know the syntax for it.
Any help appreciated!!

HI, thanks so much for your help!
The final solution was to create a new package with same code, and of course, with new updates.
The new problem is : no way to drop the old package( tried many times):
Error starting at line 1 in command:
drop package packageA
Error report:
SQL Error: ORA-04021: timeout occurred while waiting to lock object
04021. 00000 - "timeout occurred while waiting to lock object %s%s%s%s%s"
*Cause:    While waiting to lock a library object, a timeout is occurred.
*Action:   Retry the operation later.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • 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

  • How to edit stored procedure from sqlplus ?

    Hi,
    Can anyone advise how to edit stored procedure from sqlplus ?
    Many thanks.

    You can get the source for an object from SQL*Plus by querying the user_source table, i.e.
    SQL> create procedure foo
      2  as
      3  begin
      4    dbms_output.put_line( 'foo' );
      5  end;
      6  /
    Procedure created.
    SQL> select text
      2    from user_source
      3   where name = 'FOO'
      4   order by line;
    TEXT
    procedure foo
    as
    begin
      dbms_output.put_line( 'foo' );
    end;Most commonly, though, if you are using SQL*Plus and a text editor to develop stored procedures, you will have all your stored procedures in .sql files that you edit and just use SQL*Plus to create (or recreate) the stored procedures.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to compile all package body using sqlplus ?

    hi all,
    How to compile all package body using sqlplus ?
    Please help.
    Amy

    dbms_utility.compile_schema will compile all the invalid objects in a schema, including the invalid package bodies. If you only want to compile the invalid package bodies, you could write your own dynamic SQL stored procedure to do that using the user_source view, but that's a lot more effort for a very minimal benefit.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • BUG 1.5:Can't edit package body in other user.

    This is getting ridiculous. I didn't really have time to do anything with pl/sql development during the EA period and now that I do, nothing seems to work.
    I have a package and package body owned by user x. I am connected as system.
    I can edit the package, but not the body. The edit window opens, and I can compile it but I can't make any changes in the editor.
    1.5 prod with jre
    windows xp sp2
    Oracle 11.1.0.6.0

    We don't have a date scheduled for the patch release. We're working on the key issues and will release the patch when these are done. We do not plan to make this a long drawn out process.
    Sue

  • 3.0EA4: NPE when open package body from file.

    What I did:
    1. start sqldeveloper
    2. goto Files tab
    3. dblclick a package body file (a_pkg.pkb) in recent file list.
    4. dblclick another package spec file (a_pkg.pks) in recent file list.
    5. error !
    Here is the stack trace.
    java.lang.NullPointerException
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1420)
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1337)
         at oracle.ideimpl.editor.EditorManagerImpl.openEditor(EditorManagerImpl.java:1263)
         at oracle.ideimpl.navigator.OpenEditorController.whenOpenEditor(OpenEditorController.java:41)
         at oracle.ideimpl.navigator.OpenEditorContextMenuListener.handleDefaultAction(OpenEditorContextMenuListener.java:51)
         at oracle.ide.controller.ContextMenuListenersHook$LazyContextMenuListener.handleDefaultAction(ContextMenuListenersHook.java:200)
         at oracle.ide.controller.ContextMenu.fireDefaultAction(ContextMenu.java:434)
         at oracle.ideimpl.explorer.BaseTreeExplorer.fireDefaultAction(BaseTreeExplorer.java:1835)
         at oracle.ideimpl.explorer.BaseTreeExplorer.dblClicked(BaseTreeExplorer.java:2176)
         at oracle.ideimpl.explorer.BaseTreeExplorer.mouseReleased(BaseTreeExplorer.java:2205)
         at oracle.ideimpl.explorer.CustomTree.processMouseEvent(CustomTree.java:211)
         at java.awt.Component.processEvent(Component.java:5806)
         at java.awt.Container.processEvent(Container.java:2059)
         at java.awt.Component.dispatchEventImpl(Component.java:4413)
         at java.awt.Container.dispatchEventImpl(Container.java:2118)
         at java.awt.Component.dispatchEvent(Component.java:4244)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2441)
         at java.awt.Component.dispatchEvent(Component.java:4244)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

    I have several schemas but let us just look at the 2 .
    I have open connections to both of the 2 schemas.
    I do some work in the A schema and then returns
    to the B-Schema, but forget to change the connection in the connection drop down list.
    So now my connection points at the A-schema.
    I open a package body file (from the file system !!!! not from the database)
    do some corrections in the package body and then compiles the package body (belonging to the B-schema)
    erroneously in the A-schema. I do not do this on purpose, but because i forgot to change the connection
    and the connection in the "drop-down connection list" still points to the A-schema and I'm not prompted for
    a password as the connection is open.)
    The compiler compiles my package body in the A-schema with an error and tells me "package spec"
    does not exist which is true - the package spec exists in the B-schema and not in the A-schema.
    Therefore I choose the B-schema connection in the connection drop-down list in order to compile
    the package body in the right schema (the B-schema).
    Now I receive a message "your priviliges are insufficient" - which they are not.
    The only way I can get back into business is to close down sqldeveloper re-open it and now
    compile the package body in the right schema.
    Sqldeveloper compiles the pck-body in the A-schema as it was told to do, it is not a random schema
    I have to remove the pck-body afterwards !!
    The annoying thing about this is I have to close down sqldeveloper in order to be able to compile my package.
    I do not have explicit schema object reference in my declaration
    regards

  • Problems running owb 10gr2 package (mapping) from sqlplus

    not sure what i'm doing wrong.
    here is how i am trying to do it:
    1 declare
    2 out1 varchar2(100);
    3 begin
    4 entity_map.main( p_status => out1
    5 , P_MAX_NO_OF_ERRORS => '50'
    6 , P_COMMIT_FREQUENCY => '1000'
    7 , P_OPERATING_MODE => 'SET_BASED'
    8 , P_BULK_SIZE => '50'
    9 , P_AUDIT_LEVEL => 'AUDIT_COMPLETE'
    10 , P_PURGE_GROUP => 'WB'
    11 );
    12 dbms_output.put_line('Result = '||out1);
    13* end;
    SQL> /
    entity_map.main( p_status => out1
    ERROR at line 4:
    ORA-06550: line 4, column 1:
    PLS-00306: wrong number or types of arguments in call to 'MAIN'
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    here is the procedure spec:
    PROCEDURE Main(p_status OUT VARCHAR2, "TRUNCATE_LOAD" IN VARCHAR2
    DEFAULT 'false', "AW_EXECUTE_RESULT" OUT NOCOPY VARCHAR2,
    p_max_no_of_errors IN VARCHAR2 DEFAULT NULL,
    p_commit_frequency IN VARCHAR2 DEFAULT NULL,
    p_operating_mode IN VARCHAR2 DEFAULT NULL,
    p_bulk_size IN VARCHAR2 DEFAULT NULL,
    p_audit_level IN VARCHAR2 DEFAULT NULL,
    p_purge_group IN VARCHAR2 DEFAULT NULL)
    any ideas?

    nevermind..i needed to pass in another variable for "AW_EXECUTE_RESULT"

  • ORA-12571 --- Error while compiling any package body...

    Recently I am having this error when I try to compile a pacakge body it terminates my oracle session and my SQLPlus on windows NT generates a application error and shuts down. When I compile the same package body from a unix box it just goes fine. Do any of you guys encountered any similar things like this, please share your findings. I have attached the error message in the end of the message for further information.
    Thanks
    Divakar.R
    SQL> @C:\Divakar\FEA_SSR_AUTO.SQL
    Input truncated to 1 characters
    CREATE OR REPLACE Package Body FEA_SSR_Auto Is
    ERROR at line 1:
    ORA-12571: TNS:packet writer failure
    ORA-24323: value not allowed
    Error accessing package DBMS_APPLICATION_INFO
    ERROR:
    ORA-03114: not connected to ORACLE
    null

    if you look into sql.bsq in your oracle_home/rdbms
    directory, table IDL_UB2$ has storage parameter
    extents defined as maxextents.
    check out the parameter of your IDL_UB2$ table.
    By the way what is your oracle version?
    For a long time, modifying the sql.bsq file was
    frowned upon, but there is a section in the Tuning
    guide about modifying this file now.
    Reference chapter 15.
    Jaffar
    Message was edited by:
    The Human FlyBut why do you need to modify the sql.bsq file when this problem can be analyzed by checking the availability of free space in SYSTEM tablespace.
    And what benefit will you get by modifying this file after the database has been already created?
    This file is the seed of the database and I think careful consideration must be taken before even thinking of touching this file. Also you must be fully aware of the aftermath.

  • && 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.

  • Describe (Shift-F4) For Package Body

    Hi Experts,
    Just a quick query if there is an quick way of getting to view the package body from an SQL Worksheet via Shift-F4 or similar ?
    MY_CUSTOM_PACKAGE (Highlight & Shift-F4) gives me the spec, I would like to view the body (preferably have the option of viewing either spec or body/have both displayed in popup window)
    The only way I have found is to use Connection navigator, create a filter on packages with the package name and then open up the top level navigate to the body node and click to open it in another window.
    I am using ebusiness suite with 10,000's of packages in the schema, so a simple open of packages and a manual scroll is not really an option.
    Thanks

    Hi Jim,
    I have used the search however the key point is being able to select an object already in the editor or type it in and then describe and edit it from there. For example, I have a saved SQL which contains an anonymous block calling a packaged procedure that I have written. I have the package right in front of me in the SQL Worksheet, however all I can do with it at the moment is view the package spec...
    In my experience there seems to be two types of development styles out there, those who like to browse thru gui-based navigators to find things, and others who are more editor-centric in their approach (usually people who have been developing since SQL*Plus days or people who are familiar with TOAD). At the moment SQLDev while constantly improving is very much orientate towards the former.
    regards,
    Brenden

  • What is the GRANT or permission setting that allows viewing of package body

    For purposes of SOX and security/audit control, we log in under our network id's in our production environment. We have sourcecode compiled into Oracle seeded schemas ( APPS ) so that scheduled jobs are able to run with submitted from the Oracle Applications environment. We don't compile code into our personal network account areas.
    I know how to GRANT EXECUTE privs so that we can execute a package in another schema, but what I want to do is to be able to view the sourcecode in another schema. Compile into APPS but be able to see the package body from my network id schema account.
    I can't seem to find what the correct permission is anywhere. Granted I can look at DBA_SOURCE to get to it, but I want to use a tool like SQL Developer or TOAD to look at the code in a more presentable and easier to debug manner.
    Any help ?

    I guess you need GRANT DEBUG ON SCOTT.PKG TO U
    SYS@LSC01> create or replace package scott.pk is procedure p; end pk;
      2  /
    Package created.
    SYS@LSC01> create or replace package body scott.pk is procedure p is begin null; end; end pk;
      2  /
    Package body created.
    SYS@LSC01> grant create session to u identified by u;
    Grant succeeded.
    SYS@LSC01> grant execute on scott.pk to u;
    Grant succeeded.
    SYS@LSC01> connect u/u
    Connected.
    U@LSC01> select text from all_source where name='PK';
    TEXT
    package       pk is procedure p; end pk;
    U@LSC01> connect / as sysdba
    Connected.
    SYS@LSC01> grant debug on scott.pk to u;
    Grant succeeded.
    SYS@LSC01> connect u/u
    Connected.
    U@LSC01> select text from all_source where name='PK';
    TEXT
    package       pk is procedure p; end pk;
    package body       pk is procedure p is begin null; end; end pk;

  • 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.

  • Edit Package/Spec Body missing from browser

    v1.1.0.23 It seems I now have to open package specs and bodies independently. The prior version let me open both at the same time. Can this be added back in?
    Thanks

    Thank you for the effort. There are still informal steps. Here is refined test:
    7. Save is successful to package_a.sql
    7a. wait one minute
    7b. copy file package_a.sql with OS command
    7c. witness copy_of_package_a.sql having later timestamp
    7d. edit copy_of_package_a.sql to have easily identifiable content
    8. Modify package body, recompile
    9. Repeat steps 4-5-6, only change select package_a.sql name to overwrite the file with new code
    I don't understand what you are saying here, don't you want to keep fine name and location the same?
    Or you have meant that the first time around you had to input filename, and this time you just have choosen it?
    10. SQLDEV claims save is successful (it says the same thing in 'File - log' tab as well.
    11. Start windows explorer, navigate to 'Scripts' folder, sort files by last modified time descending.
    12. I can see that some other existing file was overwritten because
         a. it has a timestamp later than 'package_a.sql'
    and
        b. the randomly modified file has the new code for package_a in it, existing package_a is left as is.
    I see intact copy_of_package_a.sql and modified 'package_a.sql

  • Code from package body

    how can we view the code from package body
    Edited by: 872959 on Oct 3, 2011 9:06 AM

    Hi,
    You can use dbms_metadata
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_metada.htm#i1015856
    of query the data dictionary views user_source or all_source.
    SELECT       text
    FROM       all_source
    WHERE       owner          = 'SCHEMA_NAME'
    AND       name          = 'PACKAGE_NAME'
    AND       type          = 'PACKAGE BODY'
    ORDER BY  line
    ;Remember, anything inside quotes is case-sensitive.

  • Package body "SYS.DBMS_SQLTUNE_INTERNAL" has errors after upgrade from standard to enterprise

    Hi
    I have upgraded my Oracle 11g 11.2.0.4  from standard to enterprise version.
    When I try to use the sqladvisor I recevie the error:
    There was a problem creating a SQL tuning task.
    ORA-04063: package body "SYS.DBMS_SQLTUNE_INTERNAL" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_SQLTUNE_INTERNAL"
    ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 245 ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 684 ORA-06512: at line 1
    Looking the status of the packages, the package appears like invalid, When i try to recompile it  fails with error:
    Body
    3233
    25
    PL/SQL:
    ORA-00904: "P"."MASKED_BINDS_FLAG": invalid identifier
    Anybody know how can i recompile it ?
    I have look for the error in metakink but i can't find nothing
    thanks

    Pl detail how you upgraded to EE version
    https://docs.oracle.com/cd/E11882_01/server.112/e23633/intro.htm#UPGRD12355

Maybe you are looking for

  • Issue with Instantiation of a Class in Workflow

    I created a subclass of CL_HRASR00_WF_PROCESS_OBJECT to include some of my custom methods to be used in the workflow. Since the subclass methods cant be referred using the super class name(as we do in BO) in the standard task , i used a custom method

  • Adobe Media Encoder not launching when I clicked queue in Export Media

    Hi guys, I have been trying for about 3 weeks now trying to render my work using Adobe Media Encoder but it just won't launch as mentioend in my subject line. Upon clicking on queue, the animation showing "preparing data for export" and "exporting da

  • Light blue "finger" print spot on display

    I have a 20" Cinema display. I have noticed a light blue area on the display. You can see it if the background is white. I noticed if you have a white gradient into red, as you pass this through the affected area, this spot is darker in the transitio

  • SAP template authorization

    Hi,   Does anybody know where I can go to check what all the auth objects exists in SAP delivered templates like S_RS_RREPU BW role: Reporting user S_RS_RREDE BW role: Reporting developer S_RS_ROPAD BW role: BW Administrator etc..... I want to base m

  • Sequence A/V settings for imported still images

    I want to create a HD DVD containing a slideshow of still images with some transitions, title and ending pages and sound. Question: What A/V Sequence settings do I need to choose for a PAL 1920x1080 25fps output? Background: Till now I've done the ed