Referencing Constant in Package Spec

Hello......
Can anyone tell me if it is possible to reference a constant that is declared in the spec of a package from the Sys schema?
Thanks,
-Christine

You are correct, my error.
OTOH it is nicely working on my side:
SQL> get tt
  1  begin
  2    dbms_output.put_line(dbms_crypto.hash(UTL_I18N.STRING_TO_RAW ('Input message',  'AL32UTF8'), dbms_crypto.hash_md5));
  3    dbms_output.put_line(dbms_crypto.hash(Utl_Raw.cast_to_raw ('Input message'), dbms_crypto.hash_md5));
  4* end;
SQL> /
F107F388F61193DC50658E6BAB3EED05
F107F388F61193DC50658E6BAB3EED05
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • Package Spec

    1. what is the purpose of creating bodyless package ? what are the advantages of creating like this ?
    2. what is the reason for using "CREATE OR REPLACE PACKAGE" instead of dropping and creating ?

    Balarenganathan wrote:
    1. what is the purpose of creating bodyless package ? what are the advantages of creating like this ?Here's one example of a user for creating a bodyless package...
    Packages tend to fail because of their "package state". A package has a "state" when it contains package level variables/constants etc. and the package is called. Upon first calling the package, the "state" is created in memory to hold the values of those variables etc. If an object that the package depends upon e.g. a table is altered in some way e.g. dropped and recreated, then because of the database dependencies, the package takes on an INVALID status. When you next make a call to the package, Oracle looks at the status and sees that it is invalid, then determines that the package has a "state". Because something has altered that the package depended upon, the state is taken as being out of date and is discarded, thus causing the "Package state has been discarded" error message.
    If a package does not have package level variables etc. i.e. the "state" then, taking the same example above, the package takes on an INVALID status, but when you next make a call to the package, Oracle sees it as Invalid, but knows that there is no "state" attached to it, and so is able to recompile the package automatically and then carry on execution without causing any error messages. The only exception here is if the thing that the package was dependant on has changes in such a way that the package cannot compile, in which case you'll get an Invalid package type of error.
    And if you want to know how to prevent discarded package states....
    Move all constants and variables into a stand-alone package spec and reference those from your initial package. Thus when the status of your original package is invlidated for whatever reason, it has no package state and can be recompiled automatically, however the package containing the vars/const will not become invalidated as it has no dependencies, so the state that is in memory for that package will remain and can continue to be used.
    As for having package level cursors, you'll need to make these local to the procedures/functions using them as you won't be able to reference cursors across packages like that (not sure about using REF CURSORS though.... there's one for me to investigate!)
    This first example shows the package state being invalided by the addition of a new column on the table, and causing it to give a "Package state discarded" error...
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * v_statevar;
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALIDAnd this next example shows how having the package variables in their own package spec, allows the package to automatically recompile when it is called even though it became invalidated by the action of adding a column to the table.
    SQL> drop table dependonme
      2  /
    Table dropped.
    SQL>
    SQL> drop package mypkg
      2  /
    Package dropped.
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.The other uses are of course that you just want to create a load of type definitions etc. to be used by multiple packages elsewhere. ;)
    2. what is the reason for using "CREATE OR REPLACE PACKAGE" instead of dropping and creating ?What's the reason for dropping and recreating when you've got the option to create or replace? ;)

  • Wants Some Help About Package Spec

    Hi Friends,
    I developed one package spec in my Report.
    It has around 40 Ref Cursors.
    I created 40 Functions for those Ref Cursors.
    Right now all are in my Report at client end.
    At present the performance is very slow.
    Can i maintain these Package spec & Functions
    in data base side? If possible how ?
    If i maintain like that my performance is
    increases or not?

    You should be able to move those to the server. Read Chapter 6 in Oracle Report Documentation. Just click on topic "Documentation" on your left to find documentation on report.

  • Schema name not present on filename for "Save Package Spec and Body"

    In versions previous to 3.0 EA, the filename defaulted to schema.object.sql when using the "Save Package Spec and Body" on the right click of the package/body. This appears to have disappeared. Also, it now defaults to the .PLS ext/type, which I prefer to save them as .SQL (which i can override, but it would be nice in the file type dropdown). Also, I had posted a suggestion about the actual file not including the schema name prefixing the object name when using the "Save Package Spec and Body". i.e. it does create or replace package reader_package instead of what it should be doing which is create or replace package schema.reader_package

    Would be nice indeed having the real name as default, and all supported PL/SQL types (as in the preferences) in the extensions dropdown.
    As for the schema name inside, I reckon that would do damage for more users than it would do good for others. But a preference would be best of course.
    K.

  • Problem with "Package Spec" please help.

    Hello once again.
    I'm developing a master-detail form, so I'm using a "Package Spec" variable to hold the primary key value from the master form. The primary key value for the master is generated by a sequence.
    Here's the package spec:
    PACKAGE primary_keygen IS
    pkey varchar2(15); 
    END;Now the master table has the following "Before Insert" Trigger .
    CREATE OR REPLACE TRIGGER MASTER_NUM_GEN
    BEFORE INSERT
    ON MASTER
    FOR EACH ROW
    DECLARE
    primary_key_value varchar2(15);
    BEGIN
    select lpad(to_char(ref_gen.nextval), 4,'0')
    into primary_key_value from dual;
    primary_keygen.pkey:='ABC/'||primary_key_value;
    :new.Ref_Number:=primary_keygen.pkey;
    END;For the detail block. I have the following "Before Insert Trigger" to generate the primary key values.
    CREATE OR REPLACE TRIGGER DET1_NUM_GEN
    BEFORE INSERT
    ON DETAIL1
    FOR EACH ROW
    BEGIN
    if :new.M_ref_number is NULL THEN
    :new.M_ref_number:=primary_keygen.pkey;
    ENd if;
    END;Works quite fine if I have only one detail block. But if I have multiple detail blocks. Depending on the user's selection. i.e. After entering data into the master block, the user selects a detail block ('Letter type'- using stacked canvases for this purpose and radio buttons for selecting the view) and then Inserts data into it. here's what I do in the Detail block2.
    CREATE OR REPLACE TRIGGER OREF_NUM_GEN
    BEFORE INSERT
    ON DETAIL2
    FOR EACH ROW
    BEGIN
    if :new.O_ref_number is NULL THEN
    :new.O_ref_number:=pkey_gen.master_key;
    ENd if;
    END;Now the problem is that When I enter one record into detail1, works fine, but for the second time, when I try to insert another record. the master table gets a new reference number (primary key value) while the detail block gets the previous value that was used in the first record!, so that means 'pkey_gen.master_key' is holding the old value, while in my opinion it should hold the new value, I dont know whats wrong here. If I try to insert two consecutive records into the same detail table, I get an error saying "Unique Constraint voilated", becuase the variable is holding the old values.
    And lastly after it inserts the record into the database, I get a dialog box saying, "successfuly inserted 2 records into the database" and when I click ok, the Form closes by itself, any ideas on how to stop this?
    I'm really stuck here. Please help me out on this.
    Thanks.
    Note: I'm using Form6i with Database 10g.
    Message was edited by:
    fahimkhan82

    Hi,
    Maybe the best way to start is to try building a new form from scratch. For simplicity I will assume that you have one master and one detail table. Master table has a primary key and the detail table has a foreign key to the master. Based on this, with the forms you can create a database block based on your master table. Use the wizard. Again using the wizard, create a second block based on the detail table. You'll see a screen to prompt to create a relationship. Create one by selecting the master table and the right foreign key relation. Now take a close look to all triggers automatically created by the form. Also check the "Relations" object found in you master block object tree. Note that the foreight key column in the detail table has the "Copy Value From Item" property set to monitor the master block's primary key.
    This is the basic. You don't need the database triggers, except (in case you want to insert through, say, SLQPlus) the one for the master table, which will look like this:
    CREATE OR REPLACE TRIGGER MASTER_NUM_GEN
    BEFORE INSERT
    ON MASTER
    FOR EACH ROW
    BEGIN
    IF :new.ref_number IS NULL THEN
    select 'ABC/'||pad(to_char(ref_gen.nextval), 4,'0')
    into :new.ref_number
    from dual;
    END IF;
    END;
    Now you have to take care about the inserts in your form. Create PRE-INSERT trigger on the master block.
    IF :master.ref_number IS NULL THEN
    SELECT 'ABC/'||pad(to_char(ref_gen.NEXTVAL), 4,'0')
    INTO :master.ref_number
    FROM dual;
    END IF;
    Run the form and explore different situations to see how the form is keeping the data integrity.
    Compile with Shift+K (incremental). Sometimes forms blow just because not all of the trigers were compiled properly.
    Hope this helps...

  • Using package constants in package SQL - acts as bind variable or literal?

    I'm looking for confirmation on the performance impact of using package constants in package SQL.
    Let's say I have a number of queries in package code that refer to various literals that are prone to typos e.g. "CANCELLED" instead of "CANCELED". To reduce the chances of this happening, I have an APP_GLOBALS package where I declare constants for each literal:
    C_CANCELED CONSTANT VARCHAR2(12) := 'CANCELED';And in queries that refer to literal 'CANCELED' I use APP_GLOBALS.C_CANCELED instead. This way the typo is caught during compilation. For example:
    BEGIN
    --Do something with all 'Canceled' orders
      FOR r IN (SELECT order_id
                  FROM orders
                 WHERE status = APP_GLOBALS.C_CANCELED)
      LOOP
      END LOOP;
    END;Assume that:
    - the STATUS column is indexed
    - the possible values are PENDING, APPROVED, CANCELED
    - a small percentage of orders are CANCELED
    From the optimizer's perspective is the query equivalent to
    SELECT order_id
      FROM orders
    WHERE status = :varor
    SELECT order_id
      FROM orders
    WHERE status = 'CANCELED'?
    According to what I see in v$sqltext_with_newlines, it's the first one. Can anyone suggest an alternative way of replacing literals in package SQL to prevent typos? Worst case, I suppose I can start with constants so that it compiles successfully then do a global replace of the constants with the literals.

    Can anyone suggest an alternative way of replacing literals in package SQL to prevent typos?I cannot think of any. But, here is the thing. If the typos are there, then, it technically is a bug even though both the codes would compile. The bug will be hunted down when the program doesn't work as intended. Wouldn't most typos be caught in unit testing of the code?
    Also, if you replace a string literal with a variable, then, maybe (just maybe, depending on your version of the dbms), it may end up picking a different execution plan. That might be an unintended consequence.

  • Report cannot access pl/sql table variable defined in Package Spec.

    Hi,
    I've created a package spec called pkg_report with a PL/SQL table variable defined called body_text_table. When I tried to compile the following code under the Before Report trigger:
    :desc := pkg_report.body_text_table(1);
    Oracle gave me the following error:
    Implementation Restriction: 'PKG_REPORT.BODY_TEXT_TABLE': Cannot directly access remote package variable or cursor.
    Does anyone have any idea about this error? Thank you for your time at looking at it.
    Regards,
    John

    You cannot directly access the package variable in a database package. The work around is to create a set_variable and get_variable wrapper function in the package body. See Metalink note 105838.1 for more info.
    A simple example:
    create or replace package my_package as
      my_var     number;
      function   get_variable return number ;
      procedure  set_variable (p_value in number) ;
    end ;
    create or replace package body my_package as
      function get_variable return number is
      begin
        return my_var;
      end ;
      procedure set_variable(p_value in number) is
      begin
        my_var := p_value ;
      end ;
    end;

  • Copying Packaging Spec

    When I am copying packaging spec, the fields  'Category', 'Sub-Category' & 'Group' are getting copied over, however the fields under 'Available UOM', 'UOM Conversions' and Cross Reference' are not getting copied, whether I choose to keep the copied Spec linked to the Template or not. [Both the Spec copied from and the Template used has those UOM/Cross reference fields defined] . Aren't those UOM/Cross reference fields suppose to be copied over to the new Spec?  When I create a new Spec from Template, system brings over all fields [UOM/Cross reference etc.] from Template, so I was expecting the same behavior while copying too, since I am linking to the Template during the copying process. Can someone shed some light on this issue please?

    I believe that the functional use cases are different. When you are copying from a Template, you are not copying a real existing specification - rather, you are creating a spec with values that should be there by default. These values from a template are typically not meant to be specific to one single specification, but rather to a grouping/classification of specs. Perhaps a Beverage type specification, created from a Beverage template, would have certain Available UOMs that a Sauce specification would not. Cross References on a template may be used for pack size purposes, which may also be specific to a template.
    When you copy an existing specification, the assumption is that the specification is linked to some external system(s) using the cross references - if those were copied over, you could have an possible discrepancy. Also, since you are doing a copy and not a new revision, we assumed the UOM info would be different so is is cleared out.

  • Bug SQL Developer 3.0.04 Save Package Spec and Body to ips file bug

    Hi.
    I have problem with export package body end header. Exported ips file have some rows switched compared to original source code.
    SQL Developer version: 3.0.04. Build MAIN-04.34
    Error simulation:
    - Click on package header with right mouse button in SQL Developers Connections bar
    - In context menu choose 'Save Package Spec and Body...'
    - Save ips file... (Small bug: Offered file name is wrong (= last saved package/file, not actual name of package) :-( )
    - This file(source code) compare with original source code in Developer and u will see switched rows every +-90. row in source code.
    Can u fix this in next version of SQL Developer?
    Thanks...
    Edited by: 880809 on 22.8.2011 6:57

    Bug 12904494 has been created.
    Michael

  • Split a PL/SQL Package Spec and Body

    I hope this was not discussed in some other thread somewhere (haven't found it), but my problem is:
    How to split the Package Spec and Package Body in JDeveloper if you want to have both (for database deployment) as files in e.g. a subversion repository?
    The problem arises if you have a couple of packages that are dependent on each other, so that you have to deploy the specs first to have the "public" part in place and afterwards the bodies to define the package functions/procedures.
    Is there a way to do this?
    TIA.
    --Ciao, FD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    If you want to store for example the package "mypackage" source code in a subversion repository
    one possibility is to define 2 svn files:
    - mypackage.pks (which contains the package "specification") and
    - mypackage.pkb ( package "body").
    I haven't tried this from JDev 11.2 but it works for example when using a single-user
    svn repository from Sql Developer 2.1.1. ( in SQL Dev if you specify a database
    connection you can compile the file based pakage specification and after then the
    package body ...)
    Regards
    user_alex

  • 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

  • Can we declare a Cursor in Package Specs?

    Dear buddies
    Can I Declare a Cursor in Package Specs so that I can call that cursor and use its data in some procedures and functions of package. Otherwise I've to write that cursor for every sub-program of a package which I don't feel a smart way to accomplish the job.

    Hi,
    here is a short example with the whole way down. Maybe the concept is getting clearer with this:
    first of all, if you do not have the table emp, here the DDL for this example.
    Be carefull, works only for german clients because of the names of months, sorry for that.
    CREATE TABLE EMP
    (EMPNO NUMBER(4) NOT NULL,
    ENAME VARCHAR2(10),
    JOB VARCHAR2(9),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7, 2),
    COMM NUMBER(7, 2),
    DEPTNO NUMBER(2));
    set echo on
    INSERT INTO EMP VALUES
    (7369, 'SMITH', 'CLERK', 7902,
    TO_DATE('17-DEZ-1980', 'DD-MON-YYYY'), 800, NULL, 20);
    INSERT INTO EMP VALUES
    (7499, 'ALLEN', 'SALESMAN', 7698,
    TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30);
    INSERT INTO EMP VALUES
    (7521, 'WARD', 'SALESMAN', 7698,
    TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30);
    INSERT INTO EMP VALUES
    (7566, 'JONES', 'MANAGER', 7839,
    TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20);
    INSERT INTO EMP VALUES
    (7654, 'MARTIN', 'SALESMAN', 7698,
    TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30);
    INSERT INTO EMP VALUES
    (7698, 'BLAKE', 'MANAGER', 7839,
    TO_DATE('1-MAI-1981', 'DD-MON-YYYY'), 2850, NULL, 30);
    INSERT INTO EMP VALUES
    (7782, 'CLARK', 'MANAGER', 7839,
    TO_DATE('9-JUN-1981', 'DD-MON-YYYY'), 2450, NULL, 10);
    INSERT INTO EMP VALUES
    (7788, 'SCOTT', 'ANALYST', 7566,
    TO_DATE('09-DEZ-1982', 'DD-MON-YYYY'), 3000, NULL, 20);
    INSERT INTO EMP VALUES
    (7839, 'KING', 'PRESIDENT', NULL,
    TO_DATE('17-NOV-1981', 'DD-MON-YYYY'), 5000, NULL, 10);
    INSERT INTO EMP VALUES
    (7844, 'TURNER', 'SALESMAN', 7698,
    TO_DATE('8-SEP-1981', 'DD-MON-YYYY'), 1500, 0, 30);
    INSERT INTO EMP VALUES
    (7876, 'ADAMS', 'CLERK', 7788,
    TO_DATE('12-JAN-1983', 'DD-MON-YYYY'), 1100, NULL, 20);
    INSERT INTO EMP VALUES
    (7900, 'JAMES', 'CLERK', 7698,
    TO_DATE('3-DEZ-1981', 'DD-MON-YYYY'), 950, NULL, 30);
    INSERT INTO EMP VALUES
    (7902, 'FORD', 'ANALYST', 7566,
    TO_DATE('3-DEZ-1981', 'DD-MON-YYYY'), 3000, NULL, 20);
    INSERT INTO EMP VALUES
    (7934, 'MILLER', 'CLERK', 7782,
    TO_DATE('23-JAN-1982', 'DD-MON-YYYY'), 1300, NULL, 10);2. Package Spec:
    create or replace
    package test_cursor as
      --Type for the returncode of the function
      TYPE typ_emp IS TABLE OF emp%rowtype;
      --Array for fetching, of course also possible in the body
      t_emp typ_emp;
      --function wich returns the array from fetching the cursor
      function get_emp return typ_emp;
      --function for manupilation data retrieved by the function
      PROCEDURE man_emp;
    end test_cursor;3. Package Body
    create or replace
    package body test_cursor as
      FUNCTION get_emp RETURN typ_emp AS
      cursor c_emp is select * from emp;
      BEGIN
        open c_emp;
        fetch c_emp BULK COLLECT INTO t_emp;
        CLOSE c_emp;
        --t_emp returns the whole table set from emp
        return t_emp;
      end get_emp;
      PROCEDURE man_emp AS
      --just for not confusing names, is the same as t_emp of course
      v_emp_array typ_emp;
      BEGIN
        --call the function and retrieve the whole data set
        v_emp_array := get_emp;
        --now manipulate the data, in this case just write the names to the calling client
        FOR rec IN v_emp_array.FIRST .. v_emp_array.LAST
        loop
          dbms_output.put_line(v_emp_array(rec).ename);
        end loop;
      end man_emp;
    end test_cursor;4. Calling the procedure
    SET serveroutput ON
    exec test_cursor.man_emp;5. And this is the result:
    anonymer Block abgeschlossen
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLERPlease be aware, this is just for demonstration purpose, of course it makes no sense to display the names this way. But how to call a funktion returning arrays with datasets from fetching cursors is shown here.
    Hth
    Joerg

  • Bulk Export Package Spec and Body as single file

    Is there a way to bulk export the package spec and body into a single file, you can export spec and body if you choose each individual proc/package but if you just choose the spec/body individually from the connection - > packages list it only exports that part of the code. If not i will raise as an enhancement.
    Thanks
    Trotty

    Thanks for your update K.
    Have tried that and you can sort of do it however you still have to choose/select the spec/body individually so twice the overhead selescting them.
    Will raise an enhancement and see where it goes.
    Thanks
    Trotty

  • Define userdefined types in package spec

    perfectly working userdefined in one schema when brought in to package spec of another schema give me an error:
    Error(26,6): PLS-00540: object not supported in this context.
    I am looking for some rules to follow when decalring types in a package specifications.
    Thank you

    See following section of PL/SQL User's Guide and Reference http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/10_objs.htm#4139
    that says:
    Currently, you cannot define object types in a PL/SQL block, subprogram, or package
    The list of types that can be created in a package specification seems to be:
    - subtype: http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/03_types.htm#3359
    - collections: http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#19661
    - record:
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#7543
    - ref cursor:
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/06_ora.htm#1554
    Not sure that this is the full list because I did not find a complete list in one PL/SQL document.
    Message was edited by:
    Pierre Forstmann

  • Saving package spec and body

    In previous versions of SQL Developer, there was always an All Files option in the dropdown when saving package spec and body. Now we're using the latest version 3.1.07.42 and the only option available is to save as a .pls extension. We do not use .pls files in our system, and it's annoying to have to save as .pls and then copy the code into another file. Does anyone know a way around this, and also why Oracle has put such a restriction on the save function?

    Hi,
    Welcome to the forum. This behavior of the chooser UI for Save Package Spec and Body changed between 3.0 and 3.1, mostly for the better, I assume, except perhaps for the issue on which you comment. In general, I believe there was an effort to make the user experience more consistent across the product when opening or saving files.
    Checking this area in the code line up next for release, I see that pls and sql are the file extension choices, but not all files. Will that help?
    Regards,
    Gary
    SQL Developer Team

Maybe you are looking for

  • FM: PRICES_CHANGE error

    Hello All, I am using the FM <b>PRICES_CHANGE</b> and <b>PRICES_POST</b> to update material master prices. Table <b>T_MATPR</b> in FM is a deep structure. I am getting error when I am trying to pass the values to the CR sub table of table <b>T_MATPR<

  • Password setting for web gallery

    Plz can some one let me know how I can set password for viewing/downloading pics in web gallery? Thank VVN

  • File Upload Tomahawk - ClassCast  DefaultFileItem and DiskFileItem

    Hello, I was trying to upload a file through Tomahawk. But its giving me a ClassCastException. [Servlet Error]-[Faces Servlet]: java.lang.ClassCastException: org.apache.commons.fileupload.DefaultFileItem incompatible with org.apache.commons.fileuploa

  • Struts portlet error

    hi When i am working on struts portlet framework,i got this error,here i am sending my log file java.lang.ClassCastException: com.sun.portal.portletcontainer.portlet.impl.PortletContextImpl cannot be cast to org.apache.pluto.core.impl.PortletContextI

  • MPEG2 withou sound

    Hello, I've a mpeg2 file and when I try to put it in the time line I get only the video, without the sound. My camera is DCR-SR62. Someone knows what can I do? Please, don't say me to convert all my videos, because I've already tried and it's now com