Modifing Package's body

Hi all
I have a little problem with compiling my package.
I created a package and it has 5 procedures. Then I created Oracle job and ran tree of them. During running process, I want to modify my package's another functon which I don't use in my job. I'm changing it without any problem in Linux server, but I want to modify it in Windows server (I mean in database installed on Windows) compiling hangs up. What may be the problem and what's way of changing package's body in spite of that I'm running it's some procedures?
Thanks ...
My database's version is 10.2 installed on Windows XP

I don't know what you did in the past, but you certainly didn't change the package body of a running package!
You can't even compile a running package.... Think about it for a second, you are executing step B, but you get compiled... now where am i???
Sometimes, it is faster just to experiment it than to find the exact statement in documentation...
Try it!!!
in session A
create or replace package userx.pkgx is
procedure proca;
end;
create or replace package body userx.pkgx is
procedure proca is
v_date date := sysdate + 1/1400; --Now + 1 minute
begin
loop
exit when sysdate >= v_date;
end loop;
end;
end;
In session B:
execute userx.testx.pkgx.proca;
Now, you have 1 minute to get back to session A and try to compile the package.
You will find that it hangs for the time that the package is running.
It definitely won't change a running package...
That's for sure!!

Similar Messages

  • Mail Adapter Use Mail Package, Mail Body and Attachment

    Hello
    Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message.
    Thanks for your reply.
    Regards Tom
    The different Weblog , I have check:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

    Hi Thomas,
    If you are configuring your Mail adapter as reciever then refer
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
    your sender (say file) should have some message like this
    <i>
    <ml:Mail xmlns:ml=’http://sap.com/xi/XI/Mail/30’>
       <Subject>Important</Subject>
       <From>[email protected]</From>
       <To>[email protected]</To>
       <X_Mailer>Outlook Express </X_Mailer>
       <Content>
       This is the content.
       </Content>
    </ml:Mail></i>
    And for Sender Mail Adpater
    http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    Hope this will be helpful
    Regards
    Suraj

  • 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

  • Package Spec / Body D/B?

    D/B Package Spec / Package Body ?

    Packages bundle related PL/SQL types, items, and subprograms into one container. For example, a
    Human Resources package can contain hiring and firing procedures, commission and bonus functions, and
    tax exemption variables.
    A package usually has a specification and a body, stored separately in the database.
    You create a package in two parts: first the package specification, and then the package body.
    Message was edited by:
    Rosario Vigilante

  • Mail Package, Mail Body with CSV Mail Attachment

    Hello Experts,
    I have scenario where I need to email in case XI is not able to send data to ECC system
    I need to send CSV file as an attachment in the email.
    To mail address depens on the Warehuse Number Also i need to send some data in Email body and send CSV file as attachment.
    Can someone please let me know if this is possible
    Thanks,

    Hi,
    We have so many blogs available on this type of requirement in SDN.  Find the below mentioned few of help links for your reference, i hope below links will help you to understand on mail adapter configuration.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure

  • Modifing actionable email body

    I am able to configure the actionable emails in the BPEL. So as soon as the task appears in the human task, the email is sent to respective user's email id with the actions in it.
    User just has to click on the action and the email will be sent to SOA server to take particular action.
    Now the problem is i want user to see only few actions in the email.
    e.g. my human task is having multiple outcomes like approve, reject, cancel and request for information.
    Now by default, actionable email will have all the actions in it.
    i wan to restrict it to only Approve and Reject.
    However i do not want to remove other options (outcomes) from BPEL human task.
    How do i do this?
    Regards,
    Vikrant Korde.

    Facing the same issue ...Please let me knw if u have fixed it?

  • DBMS_METADATA Package Body won't compile

    I get a PLS-00103 error when attempting to complile the package body for SYS.DBMS_METADATA. The body hasn't been modified so I'm not sure where to look.

    Or,
    Does anyone know where in a script I can find the line that created this package and body in the first place?

  • How to retreive contents of package spec and body over jdbc

    is there a query i can issue that would return the contents (both spec and body) of a database package? similar to "desc schema.pkg" ?
    i want to issue this query via jdbc and get back the contents of the package spec/body.

    solved:
    select * from user_source where name='my_pkg'
    Message was edited by:
    user612126

  • Bug report : Navigator display wrong messages in package body

    Just run some code , you can see the Navigator display wrong messages in the package body,but the package work fine in sqlplus / toad or other tools.
    create or replace package SIMPLE AS
    Procedure simple_proc ;
    END;
    create or replace package body SIMPLE AS
    Procedure simple_proc
    IS
    v_tname varchar2(100);
    begin
    SELECT PERCENTILE_disc(0.5) WITHIN GROUP (ORDER BY tabtype DESC)
              INTO v_tname
              FROM tab;
    END simple_proc;
    END;
    Then open the package body in the Navigator (Connection Pane==> Connection Name ==> Packages ==> Simple Body ) , and show the error message:
    Unexpected token
    Missing Expression
    But if I just create the procedure out of the package , it work fine.
    CREATE OR REPLACE
    Procedure simple_proc
    IS
    v_tname varchar2(100);
    begin
    SELECT PERCENTILE_disc(0.5) WITHIN GROUP (ORDER BY tabtype DESC)
              INTO v_tname
              FROM tab;
    END simple_proc;
    /

    This has already been discussed a number of times (see http://forums.oracle.com/forums/search.jspa?objID=f260&q=Unexpected+token).
    As I understand it, it is related to the parser that SQL Developer is using to display the package decomposition in the navigator not coping with the full PL/SQL and SQL syntax (largely analytical functions from memory).

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

  • Package with and without   Body

    Hi
    How can I to Know if a Package have body or no, because there are package only CONSTANTS
    tks

    Ah, is this?
    select object_name
    from user_objects o1
    where object_type = 'PACKAGE'
    and not exists
    (select 'y'
    from user_objects o2
    where o1.object_name = o2.object_name
    and object_type = 'PACKAGE BODY'
    /* This is slow */
    select owner, object_name
    from all_objects o1
    where object_type = 'PACKAGE'
    and not exists
    (select 'y'
    from all_objects o2
    where o1.owner = o2.owner
    and o1.object_name = o2.object_name
    and object_type = 'PACKAGE BODY'
    ;

  • How to find the source code in the par files for B Package  Projects 50.3

    Hi,
    I want to modify the par files (related to Business Package Projects 50.3) which i imported into Netweavier Developer Studio. I didn’t find any jsp files or any java files in it.
    If any one worked in this Business Package for Projects 50.3, please give the solution.
    Thanks
    Ravi

    Ravi,
       The recommended appraoch for modifying Business Packages is by using NWDI - Netweaver Development Infrastructure.( new name for JDI)
        You should be able to make modification, package/build a new version and deploy. The pre-requisite is you need to set up NWDI on the server, create a Track in CMS(Change Management SErvice) and configure your DTR. Once done you can import the configuration file into your NW Developer Studio and make modifications.
      hope this helps.
    *points will be appreciated

  • Using global variable in package

    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package. Can someone help me in the declaration of this variable as a global variable? Also, is it necessary for me to initialize this variable whenever the package executes. If yes, how would I do this?
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    FUNCTION Retrieve_SerialNo RETURN VARCHAR2 IS
        v_serial_no VARCHAR2(20);
        CURSOR Serial_Code IS
          SELECT S.Serial_Code
            FROM Spare_Parts s, Orders r
           WHERE s.serial_code = r.serial_code;
      BEGIN
        OPEN Serial_Code;
        LOOP
          FETCH Serial_Code
            INTO v_serial_no;
          EXIT WHEN Serial_Code%NOTFOUND;
          v_serial_no := v_serial_no;
        END LOOP;
        CLOSE Serial_Code;
        RETURN v_serial_no;
      EXCEPTION
        WHEN OTHERS THEN
          RETURN NULL;
      END;

    user13415143 wrote:
    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package.All variables have scope or "visibility". A variable defined in a procedure is only visible within that procedure.
    A variable defines in a package body. is visible within that package body (i.e. procedures and functions in that package body can "see" that variable.
    A variable defined in the package definition? Well, who can see the definitions of procedures and function in a a package header/definition? Everyone else basically (other PL/SQL packages and procedures and functions). So this is also true for variables defined in the package interface. These are global variables that not only can be used by the code in that package's body, but also can be used by other packages and PL/SQL code.
    So when you create a global variable you need to decide on its scope:
    - define it in package header for global usage in all PL/SQL code
    - define it in package body for global usage within that package only
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    ..snipped..Ugly code as there is no need to use an explicit cursor if returning a value from a single row. Also buggy code. If there are multiple rows returned by the cursor, the function returns the serial of the last random row. How does this make sense?
    This is what I would expect to see from a function like this. You pass it a unique identifier and it returns the applicable attribute (column) value for it.
    E.g.
    create or replace function GetSerialNo( orderNo number ) return number is
      serialNo number;
    begin
      select
        s.serial_code into serialNo
      from spare_parts s,
           orders o  
      where s.serial_code = o.serial_code
      and o.order_no = orderNo;
      return( serialNo );
    exception when NO_DATA_FOUND then
      return( null )
    end;Also note that there is no need to write ugly uppercase code. This is not a proper coding standard. Programming standards for all languages (ranging from C# to Java to Delphi to Visual Basic to C/C++) specify that camelcase should be used for variables and pascalcase for procedures/functions/methods. Uppercase is very seldom used and then only for constant names and compiler options/flags for example.
    Coding reserved words in uppercase? That is just plain silly - and not found in today's programming languages. Do yourself a favour and forget the idiotic standards used by some for PL/SQL and look at the standards for Java and .Net/C# - as the latter are the de facto standards for programming (and have been for the last 2 decades and more).

  • Issue with viewing packages in SQL Developer EA2

    I posted a message when EA1 came out asking why I couldn't see the package's body in EA1.
    Now I couldn't see the any thing under '$schema/packages' in EA2.
    Does anybody know why?
    My OS: Windows XP Pro SP2
    Oracle: 9i
    SQL Developer version: EA2

    In version 9 a very simple sql is supposed to be executed:
    SELECT OBJECT_NAME, OBJECT_ID,
    DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID,
    'TRUE' runnable
    FROM SYS.ALL_OBJECTS a
    WHERE OWNER = :SCHEMA
    AND OBJECT_TYPE = 'PACKAGE'
    AND SUBOBJECT_NAME IS NULL
    -- for packages
    SELECT OBJECT_NAME, OBJECT_ID,
         DECODE(STATUS, 'INVALID', 'TRUE', 'FALSE') INVALID,
    'TRUE' runnable
    FROM SYS.ALL_OBJECTS o
    WHERE OWNER =:SCHEMA
    AND OBJECT_NAME = :PARENT_NAME
    AND OBJECT_TYPE = 'PACKAGE BODY'
    -- for package bodies
    If either of these doesn't return anything in worksheet, then the problem is right there. However, this part hasn't been changed since EA1 (The only change was adding SYS.DBA_PLSQL_OBJECT_SETTINGS requirement for version >=10). I can't reproduce the problem: in 9i scott sees any procedure/package I create.

  • Optional Parameter - Oracle Package Throws an Error

    Hi there,
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.
    " [Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_CONTRACT_BY_DYN_SQL' ORA-06550: line 1, column 7: PL/SQL: Statement ignored "
    Calling Code (ColdFusion)
    <cfstoredproc procedure="CONTRACTS_PKG.GET_CONTRACT_BY_DYN_SQL" datasource="#REQUEST.dsn#">
         <cfprocparam cfsqltype="CF_SQL_INTEGER" type="in" value="1" variable="P_CONTRACTID">     
         <cfprocresult name="qDataDynSQL" resultset="1">
    </cfstoredproc>
    <br>Dynamic SQL Query:
    <cfdump var="#qDataDynSQL#" label="Dynamic SQL Query">
    Oracle Package
    create or replace
    PACKAGE CONTRACTS_PKG AS
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR);
    END CONTRACTS_PKG;
    create or replace
    PACKAGE BODY CONTRACTS_PKG AS
    -- Get Contract Using Dynamic SQL
    PROCEDURE GET_CONTRACT_BY_DYN_SQL(P_CONTRACTID IN NUMBER, P_COLS IN VARCHAR2 DEFAULT '*', IO_CURSOR IN OUT T_CURSOR)
    IS
    V_CURSOR T_CURSOR;
    V_SQL VARCHAR2(200);
    BEGIN
    IF p_contractid > 0 THEN
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS WHERE contract_id = ' || P_CONTRACTID ;
    ELSE
    V_SQL := 'SELECT '|| P_COLS || ' FROM CONTRACTS';
    END IF;
    OPEN V_CURSOR FOR V_SQL;
    IO_CURSOR := V_CURSOR;
    END GET_CONTRACT_BY_DYN_SQL;
    END CONTRACTS_PKG;
    Does anyone knows why it throws an error? As you can see in the package header & body the parameter P_COLS has the default value as '*'.
    Looking forward to hear from someone.
    Thanks,
    Hitesh Patel

    931198 wrote:
    I have an Oracle Package & it has a stored procedure with optional parameter. The calling code is in ColdFusion.
    When I run my webpage the Oracle throws below error.Never mind the error - your approach is most definitely a candidate for Oracle WTF.
    Nothing sane about this approach. Especially the decision not to use bind variables and slowing down cursor processing significantly by burning a lot more CPU cycles on hard parsing and fragmenting the SQL Shared Pool in the process.
    Why not used MS Access instead? It is far more suited as a mickey mouse database for a goofy application?
    Why am I badmouthing your approach to Oracle? Because that is exactly the primary cause, the #1 reason, for poor Oracle performance and run-time problems dealing with Shared Pool fragmentation. It is something that many Oracle experts blog about, talk about, write about. It is addressed in numerous books, Oracle documentation, and even Oracle Support Notes.
    And despite the amount of information available on how to get the basics rights in using Oracle... this approach you are pursuing still refuses to die. So it deserves to be beaten with a lead pipe when it rears its ugly head here in this forum..

Maybe you are looking for

  • InDesign Help - eps file text going transparent.

    I am building a business card for a client and they provided me with an .eps logo. In the logo there is a white script font along the bottom of it with their saying. I place this into inDesign and everything looks fine until i .pdf the file and the t

  • Cancelling Verizon services..​..

    I just got off the phone with Verizon customer service after I learned that my bundle price that I am paying $124.99 for has been reduced by $20 per month.  I am a loyal customer of 6 years and they won't give me a discount because I already received

  • Aggregation in Calculated key figures

    hi Experts, Can anyone explain me how aggregation(normal and exception) works in calculated key figures.Plz cite some eg if possible.

  • Help - "Installation failed" Mac OSX could not be installed

    I have had a really lousy day with the Leopard install. I got the five license family pack. 2 x white MacBooks - fine - although on one the DVD kept spitting it out and after about 10 goes it worked. 1 x Mac Mini - blue screen upon restart. Still not

  • PS integration with other modules

    Hi Experts Pl tell me  from configuration point of view how ps integrates with MM , SD and FI. What are all the necessary steps we have to do in integration . Thanks in Advance