Alter Type declared in package

Hello all!
I have a package that contains a locally defined type and I would like to modify the type to contain additional columns depending on the conditions.
So I have within the package spec ....
TYPE BaseRecType IS RECORD (
, item1 varchar2(10)
, item2 varchar2(10)
, item3 varchar2(10)
and depending on the method called would like to add other columns/attributes to the BaseRecType ...
procedure A() {
-> add attribute -> item4 varchar2(20);
procedure b() {
-> add attribute -> item4 number;
I'm not sure if what I am attempting is possible, but your help is greatly appreciated.
Thanks,
Shawn

Thanks for the quick response. Both of the suggestions below have been considered and may end up being the final solution, but this requires changes to multiple applications and as such can be pretty invasive. So before that step is taken I would like to know definitively that what I would like to do is not possible.

Similar Messages

  • Declare object type inside the package

    Hi,
    How can I declare an object type inside the package?
    CREATE TYPE TempObj AS OBJECT (
    user_id number,
    text varchar2(4000),
    date_created DATE
    This will not work if placed inside this:
    CREATE OR REPLACE PACKAGE SAMPLE_PKG IS
    ---declaration goes here.
    END SAMPLE_PKG;
    I tried using the type RECORD and it worked. But I am just curious how to declare an Object. Or maybe RECORD is the replacement of Object? is this correct?
    thanks,
    Baldwin

    The inside of a PL/SQL package should contain PL/SQL statements.
    CREATE TYPE is not a PL/SQL statement. You can't create a table in package either.
    If data protection is the reason that you would rather create the type inside the package, then consider using a record type as you suggested, or hiding the SQL type in a more protected schema.
    Message was edited by:
    jonjac

  • Capturing packages with type declarations

    I have a lot of packages written in ddl files and want capture them with Designer 9i. However it seems not possible because type declarations are put not as Datastructures but as text in Package Specification field and therefore are generated after procedure declarations in package specification. Is there some methods to capture packages correctly?

    Hi,
    Can you send me an example of your problem so I can investigate it further?
    Rgds
    Susan
    Designer Product Management

  • Alter type to increase varray size

    I have the following:
    CREATE OR REPLACE TYPE idvarray is varray(10) of INTEGER
    CREATE TABLE event_availability_map
    , event_id_list          idvarray
    I would like to increase the size of idvarray, how can I do this?

    Stephen,
    With pre-10g releases, you can declare the varray to be of a large size to accomodate future growth. Oracle allocates storage based on actually used sizes.
    With 10g release, you can issue 'alter type' statement to raise the varray size limit (http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10799/adobjcol.htm#sthref310).
    Regards,
    Geoff

  • Correct use of Type declaration?

    Hello,
    I have a type declaration in a package like so:
    type get_rec_type
    IS
      record
      ( upl_id    table_name.id%TYPE
      , doc_id    table_name.eff_from%TYPE
        );I have refered to this type in my procedure declaration like so:
    PROCEDURE bulk_upload_prc
    ( p_rec OUT get_rec_type
    );Is this correct?
    The reason I ask is because I am getting the following error.
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'BULK_UPLOAD_PRC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredThank You
    Ben
    Edited by: Benton on Nov 3, 2010 12:01 PM

    Hi Toon,
    I am attempting to run it by doing the following:
    EXEC schemName.new_bulk_upload_pkg.bulk_upload_prc;And I am not supplying it any variables, because it should be getting them from the cursor that I have opened.
    and here is the cursor
    CURSOR c_get_rec_type RETURN get_rec_type;This is the package so far, I hope I am not giving you too much information ...
    SPECIFICATION
    CREATE OR REPLACE
    PACKAGE NEW_BULK_UPLOAD_PKG
    AS 
    -- DECLARE TYPES
    type get_fbt_bulk_upload_rec_type
    IS
      record
      ( upl_id    tableName.upl_id%TYPE
      , doc_id    tableName.doc_id%TYPE
      , atr_id    tableName.atr_id%TYPE
      , reference tableName.reference%TYPE
      , filename  tableName.filename%TYPE
      , mime_type tableName.mime_type%TYPE
      , eff_from  tableName.eff_from%TYPE
      , eff_to    tableName.eff_to%TYPE
      , title     tableName.title%TYPE
      , comments  tableName.comments%TYPE
    -- DECLARE CURSORS
    CURSOR c_get_fbt_bulk_upload_rec_type RETURN get_fbt_bulk_upload_rec_type;
    PROCEDURE bulk_upload_prc
    ( p_rec     OUT get_fbt_bulk_upload_rec_type
    , p_blob    OUT BLOB
    , p_srcfile OUT BFILE
    , p_max_rec OUT NUMBER
    END NEW_BULK_UPLOAD_PKG;BODY
    CREATE OR REPLACE
    PACKAGE BODY NEW_BULK_UPLOAD_PKG
    AS
      CURSOR c_get_rec_type
        RETURN get_rec_type
      IS
         SELECT upl_id
              , doc_id
              , atr_id
              , reference
              , filename
              , mime_type
              , eff_from
              , eff_to
              , title
              , comments
           FROM schemaName.tableName
          WHERE status = 'NOT LOADED';    
    -- Bulk upload procedure.
    PROCEDURE bulk_upload_prc
        p_rec     OUT get_rec_type ,
        p_blob    OUT BLOB ,
        p_srcfile OUT BFILE ,
        p_max_rec OUT NUMBER
    IS
    BEGIN
        LOOP
          FETCH c_get_rec_type INTO p_rec;
          EXIT WHEN c_get_rec_type%NOTFOUND;
          DBMS_LOB.CreateTemporary(p_blob, TRUE);
          DBMS_LOB.Open(p_blob, dbms_lob.Lob_ReadWrite);
          p_srcfile := Bfilename('UPLOAD_DIR', p_rec.filename);
          DBMS_LOB.FileOpen (p_srcfile, dbms_lob.File_ReadOnly);
          DBMS_LOB.LoadFromFile(p_blob, p_srcfile, DBMS_LOB.GetLength(p_srcfile));
           INSERT
             INTO dev_fbt_doc
              filename ,
              mime_type,
              blob_content
            VALUES
              p_rec.filename ,
              p_rec.mime_type,
              EMPTY_BLOB()
    -- Remark required
            UPDATE schemaName.TableNameB
               SET blob_content = p_blob
             WHERE filename
              LIKE p_rec.filename;
    -- Get the DOC_ID of the record that was just inserted into TableNameB.
            EXECUTE IMMEDIATE 'SELECT MAX(doc_id) FROM schemaName.TableNameB'
            INTO p_max_rec;
    -- Update the column named STATUS with the text UPLOADED to distinguish it from
    -- those records that have not been uploaded (NOT LOADED).
            UPDATE schemaName.tableName
               SET status = 'UPLOADED'
             WHERE upl_id = p_rec.upl_id;
    -- Update the column named DOC_ID to record the assigned DOC_ID for the record
    -- that was uploaded.
            UPDATE schemaName.tableName
               SET doc_id = p_max_rec
             WHERE upl_id = p_rec.upl_id;
       DBMS_LOB.FileClose(p_srcfile);
       COMMIT;
        END LOOP;
      END bulk_upload_prc;
    END NEW_BULK_UPLOAD_PKG;Thank You
    Ben
    Edited by: Benton on Nov 3, 2010 1:24 PM

  • How to use %Type declaration with table residing in a different database

    How can I use the %TYPE declaration if the table is from a different database.
    E.g
    v_business_unit ps_jrnl.header.business_unit%TYPE;
    In the above declaration statement,the table 'ps_jrnl_header' resides in a different database(Database A) from the one I am currently in( Database B).(This is because data needs to be extracted from Database A into Database B).

    1. Create a database link to the other database (this probably already exists since your proc is interacting with that database)
    2. Create a synonym for the table in the other database
    create synonym foo for ps_jrnl.header@database_a;3. Reference the synonym in your variable declaration:
    v_business_unit  foo.business_unit%TYPE;

  • SAXParser type declaration not found - PLEASE HELP!!

    I am using XML to parse an incoming string of XML. I want to use an SAXParser to do this, but I cannot create an object of this type. I have the jar file jaxp.jar, xalan.jar, and crimson.jar in my classpath.
    Is there anything else that I need to do in order to get the parser to work.
    This is a very urgent need so any help is appreciated. Here is the error:
    Class SAXParser not found in type declaration;

    I have figured out the issue. Thanks for the help. I do have one more issue though. I am trying to parse a string of xml data and I need to pass my parse() method an InputSource object that I guess I will make from my incoming String.
    Any thoughts on how to do this?

  • How could I Encrypt the data of SDO_GEOMETRY type using DBMS_CRYPTO package

    Hi:
    I want to Encrypt the data of SDO_GEOMETRY object type using DBMS_CRYPTO package.
    What could I do? hope anyone can help me,give me a suggestions!
    thanks in advance.
    lgs

    well, the spatial api would not be able to handle this data anymore, so what you are trying to do is converting an SDO_GEOMETRY to some cryptable user type (see http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm#sthref1506) and encrypting this.
    Before using the SDO_GEOMETRY type will have to decrypt and reconvert it again and pass it to the spatial query or function.

  • Alter type in 8.1.7

    hi everyone.
    i'm using the alter type statement as seen in ora92 help to work with my types written and implemented in an 8.1.7 database and its retrieving an missing or invalid option error everytime. is there some difference between 8i and 9i statements I should be aware off before trying to alter types?
    Merci.-

    There's quite a lot of difference between the 8i syntax and the 9i syntax. So you may want to compare the docs closely.
    Cheers, APC

  • Variable declaration in Package and package body

    Hi
    Kindly reply the difference in declaring a cursor inside a package vs package body
    eg:
    create or replace package shapak is
    cursor shacur is select * from sha;
    function shafun return number;
    end;
    i can declare the above cursor inside the package body withoout declaring in package specification. but what is the difference?
    reply appreciated
    thanks
    shajan

    In general..Items declared in the package spec are visible outside the package..so you can say public.where as items declared in the body are restricted to use within the package..such items are called private.

  • Wildcards in type declarations or only methods?

    Can you declare wildcards in type declarations such as:
    public class ListManager<List<?>> {
    }When I try this, I get the following compiler errror:
    C:\dev\hcj\tiger\src>c:\j2sdk1.5.0\bin\javac -source 1.5 oreilly/hcj/tiger/*.java
    oreilly/hcj/tiger/ListManager.java:21: > expected
    public class ListManager<List<?>> {
                                 ^
    oreilly/hcj/tiger/ListManager.java:31: '{' expected
    ^
    2 errorsWhat am I doing wrong [if anything]?
    TIA
    -- Kraythe

    public class ListManager<List<?>> {
    }When I try this, I get the following compiler errror:Hmm .. I was thinking about this. .. What i was trying to declare was a class that would use as a parameter any declaration of a List. So what I want is a class that will take List<Integer> and List<String> and so on. So the result would be to use it like this:
    public void someMehtod() {
        ListManager<List<String>> strListMger = ...
        ListManager<List<Integer>> strListMger = ...
    }So if not with the wildcard, how is this accoplished (if it can be accomplished at all).
    I would also like to do something like:
    public class ListManager<Type extends List<?>> {
    }In this manner I would at least have access to the type. Except the extends is a misnomer since i want type to be any List<> type.

  • Generate Java class from Oracle Type defined in Package w/ JPublisher

    I was wondering if its possible to generate a Java class for an Oracle Type defined in a Package? I know passing the package name to JPublisher (SQL <package_name>) causes all Oracle Types in the Package to have a Java class generated for them but I'd like to be able to do this for an individual Type defined in a Package (something like SQL <package_name>.<type_name>).
    Thanks for any information you can give me.

    Hi Marinel,
    The support for XSD import is limited on 10.1.2. If you can, you should consider moving to the 10.1.3 preview as the support for document style web services has improved. The other option will be to inline the schema in your WSDL.
    Eric.

  • "Global Type declaration duplicated", cached xsd conflicting in jdeveloper?

    We're having problems recompiling a project after changing a schema in a second project on which it depends:
    Our HR composite app imports a schema from our FaultHandler app. I added 2 new elements to the FaultHandler schema and redeployed to the server - now our HR composite app won't recompile. It errors saying:
    [scac] error: in EmpTransformSynch.bpel(87): query "/ns9:HandleFaultRequest/ns9:TimestampeInit" is invalid, because Global Type declaration/definition of name '{http://mydomain.com/SOA/FaultHandler}HandleFaultRequestType' are duplicated at the following locations:
    [scac] http://mydomain.com:8001/soa-infra/services/default/FaultHandlerProject/xsd/FaultHandler.xsd [line#: 4]
    [scac] http://mydomaincom:8001/soa-infra/services/default/FaultHandlerProject/FaultHandler?XSD=xsd/FaultHandler.xsd [line#: 7]
    [scac] There are at least two of them looking different:
    [scac] http://mydomain.com:8001/soa-infra/services/default/FaultHandlerProject/xsd/FaultHandler.xsd [difference starting at line#:16]
    [scac] http://mydomain.com:8001/soa-infra/services/default/FaultHandlerProject/FaultHandler?XSD=xsd/FaultHandler.xsd [difference starting at line#:19]
    I can view the 2 URIs in my browser, and while they differ slightly in how they reference another schema, the schemas (and imported schema) are semantically equivalent.
    We've taken the following steps to try to resolve it:
    Undeploy the previous revision of Fault handler
    Restart soa server
    Redepoy Fault Handler
    Clean HR app
    Make HR app
    We have the issue in both jdeveloper 11.1.1.3.0 and 11.1.1.4.0
    This is surely something very simple, but it's blockiing us at the moment.
    Any help much appreciated.
    ..Garret
    Edited by: user10714498 on 09-Mar-2011 02:27

    If your schema contains any characters which will be escaped when parsed by a browser, then version present in the actual .xsd and the version referenced via HTTP server will be different causing the issue.
    If you can post the content of your actual schema (as you see it in jDev and not the one opened in the browser) here it will help identifying the issue if any.

  • Adding XML Declaration and Document Type Declaration.

    I'm using Oracle's XML Class Generator C++ version 1.0.2.0.0. I can create classes from a defined external DTD and create my XML document. But the document does not contain the XML Declaration <?xml version='1.0?> nor does it contain the Document Type Declaration <!DOCTYPE root-element-name SYSTEM "system-identifier">. What do I need to do to get these as part of my XML document? Does the class generator have methods to do this? Could someone show me an example?

    If you invoke the print method on the top-level ELEMENT, you get
    just the body of the document with no DTD or XMLDecl. if you invoke
    print on the top level NODE (the DOCUMENT node), then the output
    document will contain the XMLDecl and DTD.
    So please try to print from DOCUMENT node.

  • Source XML data type declaration querry

    Hi all,
    I am very confused in below XML data type declaration.
    I am dealing first time with this type of XML.
    In source XML header items are mentioned in header node(address).
    <address addressline1="6th & Hunt" addressline2="" city="Pryor" state="OK" country="Sun" zip="74361">
    - <phoneinfo>
      <phone type="work">9999999999</phone>
      </phoneinfo>
    - <faxinfo>
      <fax>100000001</fax>
      </faxinfo>
    </address>
    Please Help in the "Data type declaration" of above source XML????
    How can i use this data type in message mapping????
    Thanks & Regards

    Hi Umesh,
    You can use Data types with Attributes in XI.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3b/d2a3f7a166514abb8cf5635b71974f/frameset.htm
    And you can even try with the External Definition also.
    Hope this helps,
    regards,
    Moorthy

Maybe you are looking for