3.1EA1: Database Diff Package Body

I've had some problems when comparing package bodies.
1. Sometimes two or more lines in package bodies are combined into one in the DDL and script tabs of the comparison pane in the difference report.
2. Sometimes differences in package bodies are missed completely. When this happens, the package body text shown in both sides of the DDL tab of the comparison pane are from the same connection.
Rodney

Turns out the consequences of the first problem (merging lines) I mentioned can be severe. The problem occurs when a line ends with a single quotation mark as in the following contrived example.
CREATE PACKAGE b AS END;
CREATE PACKAGE BODY b AS
    v       --'
    INTEGER --'
    :=      --'
    1;      --'
END;
/The difference process produces the following:
CREATE OR REPLACE PACKAGE BODY "B" AS
    v       --'    INTEGER --'    :=      --'    1;      --'END;/That ends up in the final script as well which means the script will fail upon execution.
Rodney

Similar Messages

  • 3.1EA1: Database Diff Comments

    1. I have trouble wrapping my brain around "Source Connection" and "Destination Connection". I keep wanting to select the connection for the schema I want to update as the source and the connection for the model schema as the destination. Anyone else have this problem? Maybe it would be better to make the connection selection fields have neutral names and use a separate control to choose which one is to be updated.
    2. I would prefer the "Show Equal Objects" checkbox in the difference report be unchecked by default. The whole point is to find differences, not matches.
    Rodney

    1: Look to it as: source is the origin, thus the schema that's complete. Destination is where the missing objects should go to, thus the incomplete schema. You wouldn't want to invert that.
    2: I agree - seems obvious.
    Regards,
    K.

  • Database Diff - Identical package bodies are reported as different

    SQLDeveloper - Version 3.2.10.09
    Package bodies (DDL) on both source and destination database are identical but package body on the source database is marked as "invalid" and package body on destination database is marked as "valid" - then Database Diff reports that package bodies different. (but on panel showing DDL for both compared package bodies there is visible no difference).
    After compiling package body on the source database (no changes in DDL) and when status of that package body changed to "valid" - now Database Diff correctly shows no difference.
    Is that intentional behavior or bug?

    >
    According to the CM team, in the previous (pre-MDAPI) incarnation of CM, status was not compared, and got complaints about that.
    >
    Point taken. Though it seems these days whichever path you take you will get complaints. ;)
    >
    It would be possible to provide the option whether to compare status of objects that have status (PL/SQL objects, triggers, views, indexes) provided MDAPI reports the status, but it's a fairly hefty enhancement.
    >
    I take that to mean that the results do now, and will continue to, take status into account.
    Perhaps my experience is using the functionality differently than what your team is working with.
    I make heavy use of the DBMS_METADATA and DBMS_METADATA_DIFF packages. Much of that functionality operates on CLOBS containing data in either the raw XML or the SXML format.
    So, to me, an XML in a CLOB has no status. So in comparing XML1 in CLOB1 to XML2 in CLOB2 the status that MIGHT have existed on the real object in the real database is irrelevant. I do comparisons between what is in version control and what is from some other source. That other source might have been, or might still be, an object in a database but status is meaningless since DDL in version control has no status. That is why, for my use cases, I wouldn't want to see a comparison fail due to a status issue.
    Oracle® Database PL/SQL Packages and Types Reference
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10577/d_metadiff.htm
    >
    85 DBMS_METADATA_DIFF
    The DBMS_METADATA_DIFF package contains the interfaces for comparing two metadata documents in SXML format. The result of the comparison is an SXML difference document. This document can be converted to other formats using the DBMS_METADATA submit interface and the CONVERT API.
    >
    That is the basis for the comments I was making; that METADATA doesn't necessarily represent an actual object in an actual database.
    Thanks for the links; I will add my vote there.

  • AP_VENDOR_PUB_PKG PACKAGE BODY issue...

    Hi there
    AP_VENDOR_PUB_PKG PACKAGE BODY become invalid can any one let me how to valid this package body because due to this we are facing problem in creating supplier.
    Regards,
    Mohsin

    Hi Helios
    Thanks for reply...please find below application & object info.
    Application: R12(12.1.2)
    Database: 11.1.0.7
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID FV_FACTS_TRANSACTIONS PACKAGE BODY
    INVALID FV_FACTS_TBAL_TRANSACTIONS PACKAGE BODY
    INVALID FV_BUDGET_DISTRIBUTION_HDR_V VIEW
    INVALID FII_AP_INV_ON_HOLD_F_C PACKAGE BODY
    INVALID FII_AP_HOLD_DATA_F_C PACKAGE BODY
    INVALID FII_AP_INV_PAYMTS_F_C PACKAGE BODY
    INVALID FII_AP_INV_LINES_F_C PACKAGE BODY
    INVALID FII_AP_SCH_PAYMTS_F_C PACKAGE BODY
    INVALID FII_AR_TRX_DIST_F_C PACKAGE BODY
    INVALID FII_PA_COST_F_C PACKAGE BODY
    INVALID FII_PA_REVENUE_F_C PACKAGE BODY
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID FII_PA_UOM_CONV_F_C PACKAGE BODY
    INVALID FII_PA_BUDGET_F_C PACKAGE BODY
    INVALID EDW_HR_ASG_CHNG_M_C PACKAGE BODY
    INVALID EDW_HR_AGE_BAND_M_C PACKAGE BODY
    INVALID EDW_HR_ASSGNMNT_M_C PACKAGE BODY
    INVALID EDW_HR_GRADE_M_C PACKAGE BODY
    INVALID EDW_HR_JOBS_M_C PACKAGE BODY
    INVALID EDW_HR_SERVICE_M_C PACKAGE BODY
    INVALID EDW_HR_MVMNT_TYP_M_C PACKAGE BODY
    INVALID EDW_HR_PERSON_M_C PACKAGE BODY
    INVALID EDW_HR_POSITION_M_C PACKAGE BODY
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID EDW_HR_REC_ACT_M_C PACKAGE BODY
    INVALID EDW_ORGANIZATION_M_C PACKAGE BODY
    INVALID EDW_HR_PRSN_TYP_M_C PACKAGE BODY
    INVALID EDW_HR_RQN_VCNCY_M_C PACKAGE BODY
    INVALID EDW_HR_REASON_M_C PACKAGE BODY
    INVALID HR_EDW_WRK_CMPSTN_F_C PACKAGE BODY
    INVALID EDW_MRP_DM_CLS_M_C PACKAGE BODY
    INVALID EDW_MRP_FORECAST_M_C PACKAGE BODY
    INVALID EDW_MRP_PLAN_M_C PACKAGE BODY
    INVALID ISC_EDW_BOOK_SUM1_F_C PACKAGE BODY
    INVALID EDW_MTL_INVENTORY_LOC_M_C PACKAGE BODY
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID OPI_EDW_COGS_F_C PACKAGE BODY
    INVALID OPI_EDW_OPM_JOB_RSRC_F_C PACKAGE BODY
    INVALID OPI_EDW_OPM_JOB_DETAIL_F_C PACKAGE BODY
    INVALID OPI_EDW_OPMCOGS_F_C PACKAGE BODY
    INVALID OPI_EDW_OPMINV_DAILY_STAT_F_C PACKAGE BODY
    INVALID EDW_OPI_OPRN_M_C PACKAGE BODY
    INVALID EDW_OPI_ACTV_M_C PACKAGE BODY
    INVALID EDW_OPI_LOT_M_C PACKAGE BODY
    INVALID EDW_OPI_PRDL_M_C PACKAGE BODY
    INVALID OPI_EDW_UOM_CONV_F_C PACKAGE BODY
    INVALID EDW_POA_SPLRITEM_M_C PACKAGE BODY
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID EDW_POA_LN_TYPE_M_C PACKAGE BODY
    INVALID QP_BUILD_SOURCING_PVT_TMP PACKAGE BODY
    INVALID FV_FACTS_TBAL_TRX PACKAGE BODY
    INVALID FV_FACTS_TRX_REGISTER PACKAGE BODY
    INVALID ITG_SYNCSUPPLIERINBOUND_PVT PACKAGE BODY
    INVALID AP_VENDOR_PUB_PKG PACKAGE BODY
    INVALID FV_SLA_PROCESSING_PKG PACKAGE BODY
    INVALID PSA_AP_BC_PVT PACKAGE BODY
    INVALID XLA_00201_AAD_S_000004_BC_PKG PACKAGE BODY
    INVALID FV_SLA_UTL_PROCESSING_PKG PACKAGE BODY
    INVALID XX_GET_PR_PO_INFO FUNCTION
    STATUS OBJECT_NAME OBJECT_TYPE
    INVALID AP_VENDOR_PUB_PKG_BK PACKAGE BODY
    56 rows selected.
    yes i have validated apps schema with adadmin utility as well
    Regards,
    Mohsin
    Edited by: 920138 on Apr 26, 2012 4:13 AM

  • Database Diff script creates redundant indexes and fails

    In Version 4.1.0.18, I create a table such that the primary key constraint and unique index have the same name:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2 BYTE),
           "COMPANY_ID" NUMBER(5,0),
           CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID", "COMPANY_ID") ENABLE
    The DDL export of this table yields a different approach but the same end results:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2 BYTE),
           "COMPANY_ID" NUMBER(5,0)
        CREATE UNIQUE INDEX "PK_MY_TABLE" ON "MY_TABLE" ("CORP_ID", "COMPANY_ID");
        ALTER TABLE "MY_TABLE" ADD CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID", "COMPANY_ID") ENABLE;
    Perfectly fine - no issue there.
    But if I do a complete Database Diff (all object types) and the target database is missing the table, the resulting script uses a combined approach:
        CREATE TABLE "MY_TABLE"
         ( "CORP_ID" CHAR(2) NOT NULL ENABLE,
           "GL_ACCOUNT" VARCHAR2(16),
           CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("CORP_ID","COMPANY_ID") ENABLE
       CREATE UNIQUE INDEX ."PK_MY_TABLE" ON "MY_TABLE" ("CORP_ID","COMPANY_ID");
    In this script, the CREATE TABLE will correctly create both the constraint and index.  Therefore the CREATE INDEX fails because the index already exists.

    In this script, the CREATE TABLE will correctly create both the constraint and index.  Therefore the CREATE INDEX fails because the index already exists.
    Can't help you beyond saying that is a bug since the DIFF should NOT do both of those.
    Someone from the sql dev team will need to tell you if the bug is in sql dev or the package sql dev is using to do the diff.
    Can you open the log window and review the SQL being generated/executed by sql dev?
    Sql Dev is likely using the DBMS_METADATA_DIFF package to generate the diff:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_metadiff.htm
    If they are using it correctly but you get that error then it is an Oracle DB bug that needs to be filed.
    If sql dev is using the package incorrectly then sql dev has a bug and the team can address that.
    Sorry I can't help you more.

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

  • Search Package Body for Keywords

    I would like to know if anyone has a query to search a package body for a particular word and then return all of the procedure names where that word (or words) are found. I am in the beginning stages of a 3-5 year upgrade/re-write project and just when I think that I have been given all of the requirements "they" come up with something else. Go figure! For instance I might need to find all of the procedures for a package or packages that contain the word product. Manually searching through all of my packages is very time consuming and I'm sure that someone out there has already written a query to do this.
    Any help will be greatly appreciated!
    Thanks!
    Randy

    >
    I would like to know if anyone has a query to search a package body for a particular word and then return all of the procedure names where that word (or words) are found. I am in the beginning stages of a 3-5 year upgrade/re-write project and just when I think that I have been given all of the requirements "they" come up with something else. Go figure! For instance I might need to find all of the procedures for a package or packages that contain the word product. Manually searching through all of my packages is very time consuming and I'm sure that someone out there has already written a query to do this.
    >
    A query? No
    Would you settle for Oracle supplied functionality that can probably provide all of that cross-reference information for you?
    As you can tell from all of the other replies it seems many, if not most, people are not familiar with PL/Scope, which was introduced in version 11.1 (you should always provide your 4 digit Oracle version).
    >
    PL/Scope is a compiler-driven tool that collects data about identifiers in PL/SQL source code at program-unit compilation time and makes it available in static data dictionary views. The collected data includes information about identifier types, usages (declaration, definition, reference, call, assigment) and the location of each usage in the source code.
    PL/Scope enables the development of powerful and effective PL/Scope source code browsers that increase PL/SQL developer productivity by minimizing time spent browsing and understanding source code.
    PL/Scope is intended for application developers, and will usually be used in the environment of a development database.
    >
    See Chapter 8 Using PL/Scope in the Advanced Appication Developer's Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm
    >
    Specifying Identifier Collection
    By default, PL/Scope does not collect data for identifiers in the PL/SQL source program. To have PL/Scope collect data for all identifiers in the PL/SQL source program, including identifiers in package bodies, set the PL/SQL compilation parameter PLSCOPE_SETTINGS to 'IDENTIFIERS:ALL'.
    >
    Without knowing your actual needs or requirements I can't speculate on whether this will give you everything you are looking for.
    But don't reinvent the wheel without checking this out first.
    Basically just set the compilation parameter and recompile all of the code. Then there will be static dictionary views available with the cross-reference data.
    Even if you are not currently using 11g if I were you I would create an 11g sandbox with all of the objects and code (no data needed) just so you could use PL/Scope to get this cross-reference information.

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

  • Can't compile package body

    hello. i ran in to little issue today. After patch 13839550 was applied to one of our test enviroments, we get one invalid package body. but when i try to compile it shows warrning!
    SQL> alter package APPS.AP_ACCTG_DATA_FIX_PKG compile body;
    Warning: Package Body altered with compilation errors.
    SQL>
    SQL> show err
    Errors for PACKAGE BODY APPS.AP_ACCTG_DATA_FIX_PKG:
    LINE/COL ERROR
    3899/3 PL/SQL: SQL Statement ignored
    3899/3 PLS-00394: wrong number of values in the INTO list of a FETCH
    statement
    Could you please explain what should i do?
    Database - 11.2.0
    eBS - 12.1
    Linux x86
    Thx

    i dont understand how can ichange something here?In this case, you can't.
    If this is one of the standard packages built into an Oracle Apps database, you need to log a tar/sr with Oracle support. (which will probably result in more patches)

  • Are PL/SQL Package Body Constants in Shared Area or Private Area

    Based on this it not clear to me if PL/SQL Package Body Constants are stored in shared area or private area.
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/memory.htm
    "PL/SQL Program Units and the Shared Pool
    Oracle Database processes PL/SQL program units (procedures, functions, packages, anonymous blocks, and database triggers) much the same way it processes individual SQL statements. Oracle Database allocates a shared area to hold the parsed, compiled form of a program unit. Oracle Database allocates a private area to hold values specific to the session that runs the program unit, including local, global, and package variables (also known as package instantiation) and buffers for executing SQL. If more than one user runs the same program unit, then a single, shared area is used by all users, while each user maintains a separate copy of his or her private SQL area, holding values specific to his or her session.
    Individual SQL statements contained within a PL/SQL program unit are processed as described in the previous sections. Despite their origins within a PL/SQL program unit, these SQL statements use a shared area to hold their parsed representations and a private area for each session that runs the statement."
    I am also curious what are the fine grained differences from a memory and performance perspective (multi-session) for the two examples below. Is one more efficient?
    Example 1.
    create or replace
    package body
    application_util
    as
    c_create_metadata constant varchar2(6000) := ...
    procedure process_xxx
    as
    begin
    end process_xxx;
    end application_util;
    vs.
    Example 2.
    create or replace
    package body
    application_util
    as
    procedure process_xxx
    as
    c_create_metadata constant varchar2(6000) := ...
    begin
    end process_xxx;
    end application_util;

    >
    What i am asking is fairly granular, so here it is again, let's assume latest version of oracle..
    In a general sense, is the runtime process able to manage memory more effectively in either case, one even slightly more performant, etc
    ie does example 1 have different memory management characteristics than example 2.
    Specifically i am talking about the memory allocation and unallocation for the constant varchar2(6000)
    Ok, a compiler's purpose is basically to create an optimized execution path from source code.
    The constant varchar2(6000) := would exist somewhere in the parse tree/execution path (this is stored in the shared area?).
    I guess among the things i'm after is
    1) does each session use space needed for an additional varchar2(6000) or does runtime processor simply point to the constant string in the parse tree (compiled form which is shared).
    2) if each session requires allocation of space needed for an additional varchar2(6000), then for example 1 and example 2
    at what point does the constant varchar allocation take place and when is the memory unallocated.
    Basically does defining the constant within the procedure have different memory characteristics than defining the constant at the package body level?
    >
    Each 'block' or 'subprogram' has a different scope. So the 'constant' defined in your example1 is 'different' (and has a different scope) than the 'constant' defined in example2.
    Those are two DIFFERENT objects. The value of the 'constant' is NOT assigned until control passes to that block.
    See the PL/SQL Language doc
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/fundamentals.htm#BEIJHGDF
    >
    Initial Values of Variables and Constants
    In a variable declaration, the initial value is optional (the default is NULL). In a constant declaration, the initial value is required (and the constant can never have a different value).
    The initial value is assigned to the variable or constant every time control passes to the block or subprogram that contains the declaration. If the declaration is in a package specification, the initial value is assigned to the variable or constant once for each session (whether the variable or constant is public or private).
    >
    Perhaps this example code will show you why, especially for the second example, a 'constant' is not necessarily CONSTANT. ;)
    Here is the package spec and body
    create or replace package pk_test as
      spec_user varchar2(6000);
      spec_constant varchar2(6000) := 'dummy constant';
      spec_constant1 constant varchar2(6000) := 'first constant';
      spec_constant2 constant varchar2(6000) := 'this is the second constant';
      spec_constant3 constant varchar2(6000) := spec_constant;
      procedure process_xxx;
      procedure change_constant;
    end pk_test;
    create or replace package body pk_test as
    procedure process_xxx
    as
      c_create_metadata constant varchar2(6000) := spec_constant;
    begin
      dbms_output.put_line('constant value is [' || c_create_metadata || '].');
    end process_xxx;
    procedure change_constant
    as
    begin
      spec_constant := spec_constant2;
    end change_constant;
    begin
      dbms_output.enable;
      select user into spec_user from dual;
      spec_constant := 'User is ' || spec_user || '.';
    end pk_test;The package init code sets the value of a packge variable (that is NOT a constant) based on the session USER (last code line in package body).
    The 'process_xxx' procedure gets the value of it's 'constant from that 'non constant' package variable.
      c_create_metadata constant varchar2(6000) := spec_constant;The 'change_constant' procedure changes the value of the package variable used as the source of the 'process_xxx' constant.
    Now the fun part.
    execute the 'process_xxx' procedure as user SCOTT.
    SQL> exec pk_test.process_xxx;
    constant value is [User is SCOTT.].Now execute 'process_xxx' as another user
    SQL> exec pk_test.process_xxx;
    constant value is [User is HR.].Now exec the 'change_constant' procedure.
    Now exec the 'process_xxx' procedure as user SCOTT again.
    SQL> exec pk_test.process_xxx;
    constant value is [this is the second constant].That 'constant' defined in the 'process_xxx' procedure IS NOT CONSTANT; it now has a DIFFERENT VALUE.
    If you exec the procedure as user HR it will still show the HR constant value.
    That should convince you that each session has its own set of 'constant' values and so does each block.
    Actually the bigger memory issue is the one you didn't ask about: varchar2(6000)
    Because you declared that using a value of 6,000 (which is 2 ,000 or more) the actual memory allocation not done until RUN TIME and will only use the actual amount of memory needed.
    That is, it WILL NOT pre-allocate 6000 bytes. See the same doc
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/datatypes.htm#CJAEDAEA
    >
    Memory Allocation for Character Variables
    For a CHAR variable, or for a VARCHAR2 variable whose maximum size is less than 2,000 bytes, PL/SQL allocates enough memory for the maximum size at compile time. For a VARCHAR2 whose maximum size is 2,000 bytes or more, PL/SQL allocates enough memory to store the actual value at run time. In this way, PL/SQL optimizes smaller VARCHAR2 variables for performance and larger ones for efficient memory use.
    For example, if you assign the same 500-byte value to VARCHAR2(1999 BYTE) and VARCHAR2(2000 BYTE) variables, PL/SQL allocates 1999 bytes for the former variable at compile time and 500 bytes for the latter variable at run time.
    >
    So when you have variables and don't know how much space is really needed do NOT do this:
    myVar1 VARCHAR2(1000);
    myVar2 VARCHAR2(1000);
    myVar3 VARCHAR2(1000);The above WILL allocate 3000 bytes of expensive memory even if it those variables are NEVER used.
    This may look worse but, as the doc states, it won't really allocate anything if those variables are not used. And when they are used it will only use what is needed.
    myVar1 VARCHAR2(2000);
    myVar2 VARCHAR2(2000);
    myVar3 VARCHAR2(2000);

  • Package body in tree view shows "unexpected token"

    I have a package which is in production for months now. This does not show any error with PL/SQL Developer nor OraEdit. SQL Developer shows "unexpected token" after trying to expand the package into the list of functions and procedures. Database is 9.2, Sql developer is 1.0.0.14.22.
    Any idea how to fix this?
    Martin

    Did you get any test material? Here is one example.
    TABLES:
      CREATE TABLE "RAPTOR"."SETTLEMENTCALENDAR"
       (     "SSRRUNNUMBER" NUMBER(*,0) NOT NULL ENABLE,
         "SETTLEMENTDATE" DATE NOT NULL ENABLE,
         "SSRRUNTYPE" VARCHAR2(2 BYTE) NOT NULL ENABLE,
         "SSRRUNDATE" DATE NOT NULL ENABLE
      CREATE TABLE "RAPTOR"."DATAFILELOG"
       (     "DATAFILEID" NUMBER(*,0) NOT NULL ENABLE,
         "FILENAME" VARCHAR2(70 BYTE) NOT NULL ENABLE,
         "FILELASTMODIFIEDDATE" DATE NOT NULL ENABLE,
         "FILETYPE" VARCHAR2(8 BYTE),
         "FILEIDENTIFIER" VARCHAR2(50 BYTE),
         "FROMPARTICIPANTID" VARCHAR2(8 BYTE),
         "FROMPARTICIPANTROLECODE" VARCHAR2(2 BYTE),
         "TOPARTICIPANTID" VARCHAR2(8 BYTE),
         "TOPARTICIPANTROLECODE" VARCHAR2(2 BYTE),
         "CREATIONTIME" DATE,
         "PERIODENDDATE" DATE,
         "FILESTATUS" VARCHAR2(50 BYTE) NOT NULL ENABLE,
         "FILESTATUSDATETIME" DATE NOT NULL ENABLE,
         "EMAILINBOXLOGID" NUMBER(*,0),
         "RESPONSEFILE" VARCHAR2(50 BYTE),
         "RESPONSEFILEGROUPID" NUMBER(*,0),
         "DATETIMERECEIVED" DATE NOT NULL ENABLE
       CREATE TABLE "RAPTOR"."ELX_MULTI_PARAMETERS"
       (     "EMP_JOB_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
         "EMP_PARAM_NAME" VARCHAR2(30 BYTE) NOT NULL ENABLE,
         "EMP_STRING_VALUE" VARCHAR2(100 BYTE),
         "EMP_DATE_VALUE" DATE,
         "EMP_NUMBER_VALUE" NUMBER
       ) ;Code
    create or replace PACKAGE "ELX_PARMS_TOOLS" AS
    procedure do_settlementcal_gap_check(cutoff_date in date default null);
    END;
    create or replace PACKAGE BODY "ELX_PARMS_TOOLS" AS
    --This procedure checks the settlementcalendar table for gaps
    procedure do_settlementcal_gap_check( cutoff_date in date default null) is
    cursor gap_cursor is
      ((select rnum
       from ( select rownum rnum
              from datafilelog )
      where rownum <= ( select max(ssrrunnumber)
                          from settlementcalendar)
    minus
      select rnum
      from ( select rownum rnum
               from datafilelog )
      where rownum <= ( select max(ssrrunnumber)
                            from settlementcalendar
                         where settlementdate <=cutoff_date))
    minus
      select ssrrunnumber from settlementcalendar)
    minus
       select emp_number_value from elx_multi_parameters
            where emp_job_name ='SETTLECAL1'
            and   emp_param_name ='GAPEXCEPTION';
    begin
    null;
    end;
    END;

  • Package body "ORACLE_OCM.MGMT_DB_LL_METRICS" has errors

    Hi
    I am getting below error in alert log file
    ORA-12012: error on auto execute of job 86070
    ORA-04063: ORA-04063: package body "ORACLE_OCM.MGMT_DB_LL_METRICS" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "ORACLE_OCM.MGMT_DB_LL_METRICS"
    ORA-06512: at line 1
    has errors
    ORACLE_OCM user is locked & Expired
    Thanks in advance for your help

    Dear Oracle_2410,
    Have you upgraded your database recently?
    Try running the utlrp.sql for several times to ensure that you don't have invalid objects on your database. It is located under $ORACLE_HOME/rdbms/admin folder.
    You can unlock the status of the ORACLE_OCM user;
    alter user ORACLE_OCM account unlock;Hope That Helps,
    Ogan

  • Invalid Package Body

    I have a working instance of a commercial product based on an Oracle database. I exported the main schema of the database. I then created a new database with identical tablespaces and users as the original. After importing the .dmp file I found that everything works fine with the exception of a single package body that will not compile due to errors. Unfortunately the code is wrapped so I am unable to view the errors. Considering I have identical tablespace and user characteristics between the two databases, and that I imported the entire main schema owner, would it be correct to assume that the errors in that package must therefore be due to missing objects of other schemas (that were not imported)?

    Could be anything really.
    - Rights and roles (are all users truely identical)
    - Missing/invalid Objects
    - Code inside the package (Maybe they check the patchlevel of your database? Or the server name) => Unlikly but possible.
    Best thing would be to get support help from the vendor of the commercial product.

  • How to find timestamp of packege/package body compiled in last 15 days

    Hi all,
    I would like to find the time stamp of package/package body compiled in the last 15 days.
    Is there any feature, which will log all the compilation time stamp of a particular package or package body.
    If so, please provide the query.
    version : Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    Thanks
    Raghu

    You can check the same from ALL_OBJECTs/USER_OBJECTS/DBA_OBJECTS.
    In this views,
    column CREATED always shows its created date & time.
    LAST_DDL_TIME always shows last compiled time also it change if you run create or replace
    TIMESTAMP will give you last change i.e. create OR replace time,
    create  package temp_pkg (v number;
                         sp_procedure());
    select object_name,object_type, created, last_ddl_time, timestamp from all_objects
    where object_type in ('PACKAGE','PACKAGE BODY')and object_name ='TEMP_PKG';
    OBJECT_NAME           OBJECT_TYPE                CREATED                   LAST_DDL_TIME             TIMESTAMP
    TEMP_PKG             PACKAGE                    11/12/2012 6:07:18 PM     11/12/2012 6:07:18 PM     2012-11-12:18:07:18
    alter package temp_pkg compile;
    select object_name,object_type, created, last_ddl_time, timestamp from all_objects
    where object_type in ('PACKAGE','PACKAGE BODY')and object_name ='TEMP_PKG';
    OBJECT_NAME           OBJECT_TYPE                CREATED                   LAST_DDL_TIME             TIMESTAMP
    TEMP_PKG             PACKAGE                    11/12/2012 6:07:18 PM     11/12/2012 6:08:19 PM     2012-11-12:18:07:18
    create  or replace package temp_pkg (v number;
                         sp_procedure());
    select object_name,object_type, created, last_ddl_time, timestamp from all_objects
    where object_type in ('PACKAGE','PACKAGE BODY')and object_name ='TEMP_PKG';   
    OBJECT_NAME           OBJECT_TYPE                CREATED                   LAST_DDL_TIME             TIMESTAMP
    TEMP_PKG             PACKAGE                    11/12/2012 6:07:18 PM     11/12/2012 6:10:00 PM     2012-11-12:18:10:00                
    alter package temp_pkg compile;
    select object_name,object_type, created, last_ddl_time, timestamp from all_objects
    where object_type in ('PACKAGE','PACKAGE BODY')and object_name ='TEMP_PKG';
    OBJECT_NAME           OBJECT_TYPE                CREATED                   LAST_DDL_TIME             TIMESTAMP
    TEMP_PKG             PACKAGE                    11/12/2012 6:07:18 PM     11/12/2012 6:11:07 PM     2012-11-12:18:10:00For packages/package body compiled/created/replaced in last 15 days you can check with below query.
    select object_name,object_type, created, last_ddl_time, timestamp
    from all_objects
    where object_type in ('PACKAGE','PACKAGE BODY')and (sysdate-last_ddl_time)<=15 ;Edited by: myOra_help on Nov 12, 2012 6:45 PM

  • DBMS_SQLPA - PACKAGE BODY - INVALID ?

    In list of SYS invalid objects I have DBMS_SQLPA - PACKAGE BODY with INVALID status…
    What could cause this problem if I don’t make it VALID?
    Someone else upgrade database from 10.2.0.1 to 10.2.0.4… Can this be the problem?
    Can I make this object VALID with this:
    SQL>sqlplus / as sysdba
    SQL>drop table plan_table;
    SQL>@?/rdbms/admin/utlxplan
    SQL>@?/rdbms/admin/prvtspao.plb
    SQL>@?/rdbms/admin/utlrp.sql
    Thanks!

    What could cause this problem if I don’t make it VALID?CATPROC will be INVALID in dba_registry. The steps you are describing are the ones descibed in MOS note ERROR IN CATUPGRD: ORA-00904 IN DBMS_SQLPA ID 565600.1*
    And utlrp recompile any remaining stored PL/SQL and Java code+
    step 15 of upgrade guide - http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/upgrade.htm#CACGGHJC
    Nicolas.

Maybe you are looking for