Modifying coding in Oracle Objects

Is there any way like to remove the specific repeated lines from the oracle objects like Function,Procedures and Packages?.For examples my certain packages are composed of more than 10000 lines of code which contains lot of dbms_output.put_line statements with different parameters.I want to remove all such statements from a specific objects with a single shot.Pls suggest.
Regards
Manoj S

Updating source code from the data dictionary views is not allowed, nor supported. You can perform a CTAS plus decode functions from the user_source if you want and perform the operation on the newly created table. But either way this cannot be directly taken back from here to the data dictionary tables, you will have to create some sort of formatted spool from this table to have the object recreated by means of the regular command CREATE OR REPLACE ...
~ Madrid
http://hrivera99.blogspot.com/

Similar Messages

  • Oracle Object Table Type

    I have an application that I would like to map bc4j to a object type hierarchy in the database. From reading previous otn threads I'm under the impression that Domains are not used for Oracle Table Types, just for columns based on oracle types. The thread later goes on to say that for the base type (person_typ) I would map a entity object to the table(person_table) mapped to the base type. To map all the sub-types I would create new entity objects and have PersonEO subclassed into StudentEO and EmployeeEO.
    I have done this and it's unclear to me when I subclass PersonEO as StudentEO how do I declare that StudentEO is of oracle object type student_typ?
    I'm also having problems with inserting data into the base entity obect. Here's code:
    PersonVOImpl personVo = am.getPersonVO();
    PersonVORowImpl row = (PersonVORowImpl)personVo.createRow();
    personVo.insertRow(row);
    row.setName("Mark");
    row.setPhone("911");
    am.getTransaction().commit();
    personVo.executeQuery();
    while (personVo.hasNext()){
    PersonVORowImpl personRow = (PersonVORowImpl)personVo.next();
    The data gets comitted to the db correctly but when the code hits personVo.executeQuery() I get the following error:
    oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
         at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:687)
         at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:80)
         at oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(OracleSQLBuilderImpl.java:1113)
         at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:2017)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1013)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2309)
         at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:2240)
         at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:1698)
         at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:1552)
         at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1008)
         at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:2791)
         at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2504)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2368)
         at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2569)
         at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:1641)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:577)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:611)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:593)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:2886)
         at model.testing.main(testing.java:33)
    Am I coding this correctly? I'm using jdev9032 for this. Are there any examples out there on how to correctly use bc4j with oracle object type tables?
    Thanks in advance!
    -Mark

    Here is my ddl:
    CREATE TYPE Person_typ AS OBJECT
    ( name VARCHAR2(30),
    address VARCHAR2(100)) NOT FINAL
    CREATE TABLE PERSON_TABLE OF PERSON_TYP
    I map a entity object to person_table one for one and I edit the SYS_NC_OID$ property of updateable to never.
    I then map a view object one for one to the entity object. The jbo trace I get when -Djbo.debugoutput=console is declared is the following (omitted everything before the db connected).[156] Successfully logged in
    [157] JDBCDriverVersion: 9.0.1.4.0
    [158] DatabaseProductName: Oracle
    [159] DatabaseProductVersion: Personal Oracle9i Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production
    [160] ViewRowSetImpl's jbo.viewlink.consistent = false (0)
    [161] Column count: 3
    [162] Executing SQL in generateRefAndOID...
    [163] select a.oid, make_ref(PERSON_TABLE, a.oid) from (select /*+ NO_MERGE +*/ sys_op_guid() as oid from dual) a
    [164] OracleSQLBuilder Executing DML on: PERSON_TABLE (Insert)
    [165] INSERT INTO PERSON_TABLE(NAME,ADDRESS) VALUES (:1,:2)
    [166] BaseSQLBuilder: releaseSavepoint 'BO_SP' ignored
    [167] PersonVO notify COMMIT ...
    [168] Column count: 3
    [169] ViewObject : Created new QUERY statement
    [170] SELECT REF(PersonTable), PersonTable.NAME, PersonTable.ADDRESS FROM PERSON_TABLE PersonTable
    [171] LoadBulkFromResultSet failed (2)
    oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
         java.lang.Object oracle.jbo.domain.TypeFactory.get(java.lang.Class, java.lang.Class, java.lang.Object)
              TypeFactory.java:687
         java.lang.Object oracle.jbo.domain.TypeFactory.getInstance(java.lang.Class, java.lang.Object)
              TypeFactory.java:80
         java.lang.Object[] oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(oracle.jbo.server.AttributeDefImpl[], int, java.sql.ResultSet, int, oracle.jbo.server.DBTransactionImpl)
              OracleSQLBuilderImpl.java:1059
         void oracle.jbo.server.ViewRowImpl.populate(java.sql.ResultSet)
              ViewRowImpl.java:1964
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(oracle.jbo.server.ViewObjectImpl, oracle.jbo.server.QueryCollection, java.sql.ResultSet)
              ViewDefImpl.java:1019
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(java.lang.Object, java.sql.ResultSet)
              ViewObjectImpl.java:2035
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(oracle.jbo.server.QueryCollection, java.sql.ResultSet)
              ViewObjectImpl.java:1966
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.QueryCollection.populateRow()
              QueryCollection.java:1395
         boolean oracle.jbo.server.QueryCollection.fetch(int)
              QueryCollection.java:1237
         java.lang.Object oracle.jbo.server.QueryCollection.get(int)
              QueryCollection.java:832
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.getRow(int)
              ViewRowSetImpl.java:2621
         void oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(int)
              ViewRowSetIteratorImpl.java:2347
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
              ViewRowSetIteratorImpl.java:2211
         void oracle.jbo.server.ViewRowSetIteratorImpl.refresh(boolean, boolean)
              ViewRowSetIteratorImpl.java:2412
         void oracle.jbo.server.ViewRowSetImpl.notifyRefresh(boolean, boolean)
              ViewRowSetImpl.java:1556
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:548
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
              ViewRowSetImpl.java:564
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:2616
         void mypackage1.testing.main(java.lang.String[])
              testing.java:25
    Exception in thread main
    Process exited with exit code 1.
    Please let me know if you need more information.
    -Mark

  • ARE ORACLE OBJECTS ALWAYS  STORED IN UPPERCASE

    Are the oracle objects always stored in Capital letters?
    Say ,for example If I create a table as 'Table A' , It gets stored in the USER_TAB_VIEWS as TABLE A !! Is there a way to get it back as 'Table A'

    ..Is there any way to do it..Yes, as I indicated, use double quotes.
    I am modifying an application that worked on SQL Server and hence forced to
    use mixed caseI'm not sure that follows. Unless of course the app has database objects whose only difference is the use of CamelCase, e.g. tables called TableA and Tablea and (why not?) tableA. If the names are unique in a case insensitive mode then I think you are better off using Oracle's default naming convention.
    But you know what you are doing, and if you think that using ...
    SELECT * FROM "CamelCase"
    SELECT * FROM user_tables
    WHERE table_name = 'CamelCase'
    /... is a lesser world of pain than ...
    SELECT * FROM camelcase
    SELECT * FROM user_tables
    WHERE table_name = 'CAMELCASE'
    /... then do go ahead.
    Cheers, APC

  • Domains for Oracle object types

    When I create a domain for a certain Oracle object type there is no way to create some kind of inheritance tree (and there is no discriminator support it seems). On the database level I have several object types that extend a certain base object type. I want to do the same at the BC4J level. But unfortunately this doesn't seem possible. Is there a work-around for it? I don't mind to write a little extra code, any hints or help are appreciated.
    Regards,
    Peter
    P.S.
    It seems the object type / domain support in JDeveloper 9.0.3(.1) isn't quite up there with entities and view objects. It's not even possible to change an attribute name at the Java side using the domain dialog (it's only possible by manually editing the XML and Java files). Will JDeveloper 9.0.4 have broader support for object types / domains?

    I've found a way to implement the inheritance myself, at least a start. I've noticed all custom domains for oracle object types have the static method "getCustomerDatumFactory". In this method (in the base domain class) normally an instance of the base type is returned. I've modified this method so that it returns instances of the different subtypes depending on the value of a certain column. To make this work I first have to edit the Java files of the subtypes and let them extend the base type instead of the Struct class. The factory method looks like this:
    public static CustomDatumFactory getCustomDatumFactory()
        if (fac == null)
          class facClass implements CustomDatumFactory
            public CustomDatum create(Datum d, int sql_type_code) throws SQLException
              if (d != null)
                BaseType b = new BaseType(d);
                if ("subtype1".equals(b.getType())) b = new SubType1(d);
                else if ("subtype2".equals(p.getType())) b = new SubType2(d);
                else System.err.println("Unknown subtype: " + b.getType());
                return b;
              return null;
          fac = new facClass();
        return fac;
      }I also tried to save several of the subtypes in the database in the attribute field (which is of the base type) using setAttribute, this seems to work out-of-the-box. It seems for now I only get this to work if the object type is saved in a column of a certain table, I can't get it to work (yet) for object type tables (see the other recent topic of mine).
    Is this the correct way to implement what I want? Or is there a better way?
    Regards,
    Peter

  • How to return Values from Oracle Object Type to Java Class Object

    Hello,
    i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
    CREATE OR REPLACE TYPE person_type AS OBJECT
    ID NUMBER,
    vorname VARCHAR2(30),
    nachname VARCHAR2(30),
    geburtstag DATE,
    CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
    p_nachname VARCHAR2,
    p_geburtstag DATE) RETURN SELF AS RESULT,
    MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
    MEMBER PROCEDURE load_object(p_id NUMBER),
    MEMBER PROCEDURE save_object,
    MEMBER PROCEDURE insert_object,
    MEMBER PROCEDURE update_object,
    MEMBER PROCEDURE delete_object
    MEMBER PROCEDURE load_object(p_id NUMBER) IS
    BEGIN
    SELECT p.id, p.vorname, p.nachname, p.geburtstag
    INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
    FROM person p
    WHERE p.id = p_id;
    END;
    My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
    PersonObjectType p = new PersonObjectType();
    p.load_object(4);
    There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
    Thanks a lot.
    Edited by: NTbc on 13.07.2010 15:36
    Edited by: NTbc on 13.07.2010 15:36

    CallableStatement =
    "DECLARE
    a person_type;
    BEGIN
    a.load_object(4);
    ? := a;
    END;"
    And register as an out parameter.
    Edited by: michael76 on 14.07.2010 05:01

  • Performance of mapping Oracle objects to Java classes

    Hi,
    By retrieving some test data from Oracle database in a Java application, I compared the traditional JDBC/RDBMS solution to JPublisher-generated-classes/Oracle-object-tables solution. The underlaying Oracle database and the client environment was the same in both tests. Although the table schemas were different, they represented the same data.
    It seems that the traditional JDBC/RDBMS solution is much faster. Is this a reality or did I make a mistake somewhere?
    BR,
    Timo

    I am also facing performance overhead when using Jpub generated
    classes for the object types.
    I am using 817 jdbc and jpub but my database is 816. I have seen
    that following statements each take around 2-3 seconds to
    execute. Is there any communication between driver and database
    to resolve the object type ?
    Please help.
    cCallableStatement =
    (OracleCallableStatement)m_cConnection.prepareCall("{call
    list_unsync_appts_array(?,?,?,?,?,?,?,?)}");
    ((OracleCallableStatement)cCallableStatement).setCustomDatum(1,ct_number_arr);
    cCallableStatement.registerOutParameter(2,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
    cCallableStatement.registerOutParameter(3,OracleTypes.ARRAY,"T_EVENT_DETAIL_ARR");
    cCallableStatement.registerOutParameter(4,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
    cCallableStatement.registerOutParameter(5,OracleTypes.ARRAY,"T_EVENT_DETAIL_ARR");
    cCallableStatement.registerOutParameter(6,OracleTypes.ARRAY,"T_EVENT_SUMMARY_ARR");
    cCallableStatement.registerOutParameter(7,OracleTypes.ARRAY,"T_ATTENDEE_EMAIL_ARR");
    cCallableStatement.registerOutParameter(8,OracleTypes.ARRAY,"T_ATTENDEE_EMAIL_ARR");
    cCallableStatement.execute();

  • How to use Oracle objects in java code

    Hi all!
    I'm reading an xls and i need to fill me oracle objects with java code:
    OBJECT_NAME OBJECT_TYPE
    LETTURA_OBJ TYPE
    LETTURA_OBJ TYPE BODY
    In the past weeks i've been using both java code into oracle and oracle objects, but new i need to write those objects with data i read with java, anybody can help me?
    I know that the easiest work around would be to put the data i read from the excel file into a table and then fill the oracle objects, but now i want to learn how to write directly those objects with a command like the following one:
    a sample of the code i'm tryng to write:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import jxl.*;
    public cass ....
    #sql{  variabili_globali.var_ER_F3.Tipo_Lettura := 5}
    thanks,
    Massimo
    Edited by: LinoPisto on 16-mag-2011 16.38

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • How to get the users list that can Add/Remove or modify Vendors in Oracle?

    How to get the users list that can Add/Remove or modify Vendors in Oracle?
    I need to generate a report like name and responsibility. Thanks

    That query gives the Supplier information.
    But what i would be needing is to find out the USERS in oracle who can Add/Modify or Remove Vendors.
    I assume it should be based on the Responsibility.

  • Use of Complex Oracle Object with JDBC

    How can I use Oracle Object(or PL/Sql type) with JDBC
    I have a structure of record with some attributes and table of another attribute.
    My types are defined as follows !
    <code>
    CREATE TYPE EMPLOYEE_GRADES AS TABLE OF VARCHAR2(50)
    CREATE TYPE EMPLOYEES AS OBJECT(EmpName VARCHAR2(50), EmpGrades Employee_Grades)
    </code>
    My custom object might have the following structure (or should it be different)
    <code>
    public class EmpColl implements CustomDatum, CustomDatumFactory
    -- other stuff ----
    /* fields */
    public String empName;
    public Collection empNos;
    </code>
    I want to pass an variable of type EMPLOYEES to an procedure.
    Thanx in Advance
    Chetan
    [email protected]

    <code>
    CREATE TYPE EMPLOYEE_GRADES AS TABLE OF VARCHAR2(50)
    CREATE TYPE EMPLOYEES AS OBJECT(EmpName VARCHAR2(50), EmpGrades Employee_Grades)
    </code>The easiest is to use JPublisher (which comes with the SQLJ distribution).
    Say:
    jpub -user=username/password -sql=EMPLOYEES:Employees,EMPLOYEE_GRADES:EmployeeGrades
    You will get (among others) the Java files Employees.java and EmployeeGrade.java. Go ahead, compile and use them.
    Look in [Oracle Home]/sqlj/demo/jpub for a number of additional examples, and in the JPublisher User's Guide for background info.
    The next (9.2) release of JPublisher will also provide some support for accessing legacy PL/SQL types from Java.

  • Oracle Objects and Domains in Java Server Pages

    We have defined this object in a Oracle 816 Enterprise:
    CREATE TYPE DESCRIPTOR AS OBJECT
    ( ID VARCHAR2(30),
    DESCRIPTOR VARCHAR2(80))
    create TYPE descriptor_table AS VARRAY(30) of DESCRIPTOR
    create table foo_test
    (foo_test_id varchar2(10),
    descrip descriptor_TABLE )
    ALTER TABLE foo_test
    ADD CONSTRAINT BIBL_test_PK PRIMARY KEY (foo_test_id)
    then we have created in JDeveloper 3.1 an Entity (footest) object and a Domain (DescriptorDom) for the type DESCRIPTOR; then set the type of attribute descript to mypackage.DescriptorDom
    After that, we created a JavaServer Page as follows:
    <jsp:useBean class="oracle.jbo.html.databeans.JSRowSetBrowser" id="abean" scope="request" >
    <% abean.setShowCurrentRow(true); abean.setVisibleRows(10); abean.setShowRecordNumbers(true); abean.setReleaseApplicationResources(false); abean.setDisplayAttributes("FooTestId,Descrip"); abean.initialize(pageContext,"ot_logics_LogicsModule.FooTestView");
    abean.render();%>
    </jsp:useBean>
    The execution of JSP shows the error:
    java.lang.ClassCastException
    void oracle.jbo.domain.Struct.convertArrayToStruct()
    java.lang.Object oracle.jbo.domain.Struct.getAttribute(int)
    java.lang.String oracle.jbo.domain.Struct.toString()
    void oracle.jbo.html.databeans.JSRowSetBrowser.internalInitialize()
    void oracle.jdeveloper.html.WebBeanImpl.initialize(javax.servlet.ServletContext, javax.servlet.http.HttpSession,
    javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.PrintWriter)
    void oracle.jdeveloper.html.DataWebBeanImpl.initialize(javax.servlet.ServletContext, javax.servlet.http.HttpSession,
    javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.io.PrintWriter, java.lang.String)
    void oracle.jdeveloper.html.DataWebBeanImpl.initialize(javax.servlet.jsp.PageContext, java.lang.String)
    void ot_pages_html.bibl_test._jspService(javax.servlet.http.HttpServletRequest,
    javax.servlet.http.HttpServletResponse)
    void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.jsp.app.JspApplication.dispatchRequest(javax.servlet.http.HttpServletRequest,
    javax.servlet.http.HttpServletResponse)
    void oracle.jsp.JspServlet.doDispatch(oracle.jsp.app.JspRequestContext)
    void oracle.jsp.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.lite.web.JupServlet.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.MimeServletHandler.handle(oracle.lite.web.JupApplication, java.lang.String, int,
    oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupApplication.service(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.JupAppHandler.handle(oracle.lite.web.JupRequest, oracle.lite.web.JupResponse)
    void oracle.lite.web.HTTPServer.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    void oracle.lite.web.HTTPServer.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    boolean oracle.lite.web.HTTPServer.handleRequest(oracle.lite.web.JupInputStream, java.io.OutputStream)
    boolean oracle.lite.web.JupServer.handle(oracle.lite.web.JupInputStream, java.io.OutputStream)
    void oracle.lite.web.JupHTTPListener$JupHTTP.run()
    Please JTeam, could you illuminate me about how implement ORACLE objects in Entity object s and JavaServer Pages?
    ps The code generated by JPublisher seems be more complete that done by wizard of Domains. We sould use JPublisher?. How set the attribute type?
    Thank in advance.
    J Luis

    Hi,
    It looks like this might be a bug. I am going to use the information you supplied to file a bug so our QA team can investigate.
    We have had problems with arrays of structs, but hope to have them fixed with our next release.

  • Oracle Object Types vs. Table Fields

    Hello, all.
    I`m totally new to Oracle, and I am facing a very hard problem for me, and I would like to ask your help.
    I've been working on a project which uses Oracle Object Types, from a database of a legacy system.
    I did not know Oracle Objects until 5 minutes ago, so sorry If I say something stupid:
    Per my understanding, a Oracle Object Type can be formed by fields like myField varchar(200)... and fields from an existing table or view.
    I have a lot of objects on my system and I need to map each field and its respective table or view that compose each object.
    Does anyone have a query for that? I think it should be common, but I could not find anything at google (maybe I don`t which terms use to find...)
    I would be very thankful if somebody could help (save) me.
    Thanks in advance.
    Paulo

    First, it would help if you post what you object types look like.
    I'm assuming they may look something like this:
    SQL> create TYPE emp_type AS OBJECT
      2    (emp_id   NUMBER,
      3     name VARCHAR2(20));
      4  /
    Type created.
    SQL> create TYPE emp_tab IS TABLE OF emp_type;
      2  /
    Type created.
    SQL> create or replace package emp_test as
      2  procedure get_emps;
      3  end emp_test ;
      4  /
    Package created.
    SQL> create or replace package body emp_test as
      2    employees emp_tab := emp_tab();
      3    procedure get_emps as
      4      g_rc sys_refcursor;
      5  BEGIN
      6    employees.EXTEND(2);
      7    employees(1) := emp_type (1, 'John Smith');
      8    employees(2) := emp_type (2, 'William Jones');
      9    OPEN g_rc FOR
    10    SELECT * FROM TABLE (CAST (employees AS emp_tab));
    11  END get_emps ;
    12  end emp_test ;
    13  /
    Package body created.

  • Oracle Object Views Jdeveloper compatibility

    Our application has been designed OOAD and documented in UML. We mapped the UML class diagrams to relational tables and created Oracle object views on top of these tables. From these views we can now generate C++ code with OTT. However, trying to access these views from JDeveloper gives us some problems. Specifically, if an object type defined by "CREATE TYPE xxx AS OBJECT" has a REF column somewhere inside it, there seems to be very little support for this in JDeveloper 10g. Our example is a country with numerous provinces. A provice type has a reference to the country type it falls in. Trying to make a GUI to maintain the provinces gives us no way to select a country to make the REF column from. In JDeveloper, when using the object view to create a maintenance GUI, we see the reference to the country in binary form. Typically we would want to select the country from a drop-down box containing country names instead of binary references. Can someone please point me to documentation describing how to do this or explain here. Thank you in advance.

    Not sure if this will be helpful for you, but maybe a better approach for your Java project will be to use TopLink to map your Java objects directly to the relational schema using TopLink's meet-in-the-middle capabilities.
    This way you won't need to work with the Object views in the database.
    More on TopLink here:
    http://www.oracle.com/technology/products/ias/toplink/index.html
    Some demos of the mapping capabilities are here:
    http://www.oracle.com/technology/products/ias/toplink/mwdemos/index.html
    TopLink is very well integrated with JDeveloper 10.1.2

  • Oracle object cols and inserts

    hi,
    i have a type defined as follows
    create type foo
    a number(10),
    b number(10),
    c date, d date);
    now i use this in a table as follows
    create table test
    foo_obj foo default foo(-1, -1, sysdate, sysdate) not null,
    foo_name varchar2(100) not null
    now what im really interested in is when i do
    an insert id like to specify only some of
    the values for a given obj
    aka
    insert into test(foo_obj, foo_name)
    values (foo_obj.a(10), 'test')
    so the rest of the values for that obj
    come from the defaults specified..
    ive been unable to find examples for the above method in the 8i docs & any help here
    on the correct syntax with an example would
    help enormously
    thanx
    pete
    null

    Oracle® Database Object-Relational Developer's Guide
    Also note that object relational database design is often less performant and scalable than relational. It is not very often used in production environments.
    However, the object orientated programming feature that is provided with Oracle object feature set are used and can make development and interfaces a lot easier.
    So in a nutshell. Say no to ref and nested table columns. Say yes to most of the other object features. IMO of course...

  • Oracle object, nested table on a subtype

    Hello,
    Is it possible to have a nested table on a subtype? If it is, can someone help me?
    Here is what I need help for:
    I have a supertype WORK, that have:
    multivalued attribute ADDRESS
    a attribute NAME, also the primary key
    The subtype is called EMPLOYEE, that have:
    multivalued attribute SPECIALTY
    a attribute NAME
    a attribute SSN
    So far have I got:
    //* The supertype *//
    create or replace type ADRESS_TP as object(
    ADRESS varchar2(50));
    create or replace type ADRESSTP as table of ADRESS_TP;
    create or replace WORK_TP as object(
    NAME varchar2(30),
    ADRESS ADRESSTP)
    NOT FINAL;
    create table WORK_TBL of WORK_TP(
    Primary key(NAME))
    nested table ADRESS store as NT_ADR(
    (Primary key(nested_table_id, ADRESS))
    organization index compress);
    //* The subtype *//
    create or replace type SPECIALTY_TP as object(
    ADRESS varchar2(50));
    create or replace type SPECIALTYTP as table of SPECIALTY_TP;
    create or replace EMPLOYEE_TP under work_tp(
    NAME varchar2(30),
    SSN number)
    FINAL;
    The multivalued attribute SPECIALTYTP has to be declared in WORK_TBL have I been told, but how can I do that?
    I'm using oracle 9i

    I'm not really sure what your problem is. In future please be specific about what it is you are trying to do and what it is that is not working. If it's an error please give us the error message and number. It's not the behaviour you are expecting please describe what it does. If it's that you simply don't understand please say what you don't understand.
    I go on like this because the code you have posted is somewhat confusing. The Oracle object-oriented implementation is not quite complete so that makes it hard for people who know OO but don't know Oracle. Whereas most of us who know Oracle aren't expert in OO. Also, I think you should be slightly more inventive in your names: there's so many things called ADRESS it's easy to get them tangled up.
    Anyway, here's my guess at what I think your problem is....
    SQL> CREATE OR REPLACE TYPE adress_t AS OBJECT(
      2  line1 VARCHAR2(50)
      3  ,line2 VARCHAR2(50)
      4  ,postcode VARCHAR2(8));
      5  /
    Type created.
    SQL>
    SQL> CREATE OR REPLACE TYPE adress_nt AS TABLE OF adress_t;
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE work_t AS OBJECT(
      2   name VARCHAR2(30),
      3   adresses adress_nt)
      4  NOT FINAL;
      5  /
    Type created.
    SQL> CREATE TABLE work_tbl OF work_t
      2     NESTED TABLE adresses STORE AS adress_ntab
      3  /
    Table created.
    SQL> CREATE OR REPLACE TYPE specialty_t AS OBJECT(
      2  description VARCHAR2(50));
      3  /
    Type created.
    SQL> CREATE OR REPLACE TYPE specialty_nt AS TABLE OF specialty_t;
      2  /
    Type created.
    SQL>
    SQL> ALTER TYPE work_t ADD ATTRIBUTE specialities specialty_nt CASCADE
      2  /
    Type altered.
    SQL> DESC work_tbl
    Name                                      Null?    Type
    NAME                                               VARCHAR2(30)
    ADRESSES                                           ADRESS_NT
    SPECIALITIES                                       SPECIALTY_NT
    SQL> Cheers, APC

  • Help on accessing Oracle object !

    Hi,
    Looking for a help in accessing oracle object using JDBC. I've the following object defined in Oracle.
    TYPE ty_ctg_prod AS OBJECT(
    PROD VARCHAR2(40 ),
    NODE_ID NUMBER ,
    CTG_ID NUMBER );
    TYPE ctg_PROD_ary AS VARRAY (50) OF ty_ctg_PROD;
    The procedure out parameter is returning :
    x_ctg_prod_ary OUT ctg_prod_ary
    Do I need to use a OracleTypes.STRUCT API Or oracle.sql.ARRAY to access data in this scenario.
    Any pointers will be highly appreciated.
    Thanks,
    Shamik

    // Get the object1 value from the second column col_object1
                oracle.sql.STRUCT object1 = (oracle.sql.STRUCT)collabstatement.getObject(2);
                // Get the object1 values from each row
                Object[] object1Values = object1.getAttributes();
                // Get the first value of object1, which is a string
                String str = (String)object1Values[0];
                // Get the second value of object1, which is of the type object2
                oracle.sql.STRUCT object2 = (oracle.sql.STRUCT)object1Values[1];
                // Get the values of object2
                Object object2Values[] = object2.getAttributes();
                str = (String)object2Values[0];
                BigDecimal num =  (BigDecimal)object2Values[1];you can also use :oracle.sql.Datum[] attrs = oracleSTRUCT.getOracleAttributes();more info :
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/objects/ObjectTypes.html

Maybe you are looking for

  • Issue in Preview through XML forms having TinyMCE editor

    Hello Experts, I have one issue in our client portal, which is really giving me hard time to resolve. So I have come to you experts for helping me to resolve this issue. So below are the details of the issue. Actually it goes like that, we are using

  • How to make "Show All" folders the default in Finder

    I recently upgraded to Mountain Lion and I'm having a lot of problems customizing my Finder folders to my liking. I love the new "Arrange By..." function, but the only thing that's bothering me is having to manually click "Show All" for my folders an

  • PPTP Problems with RV320

    I just bought a new RV320 to replace my older RV082 in my local office network. I was able to get the RV320 set up and running, but had a problem with the PPTP settings. On the RV082 I have three gateway-to-gateway VPNs set up and when a user logs in

  • I only have 2 apps on my ipad bt it says I have used up 10 GB

    I only have 2 apps on m ipad and everything in setting adds up to 3GB but on setting its says I have used up 10GB how do I get my storage back

  • Communication Error in VC 7.0

    Hi All. I am usinf EP 7.0 SP 17. I have done Portal Activity Report in VC. Portal database is DB2. I write the Query in SQL Editor. Query works fine in SQL Editor. I can deploy the VC application without Error.But if i run that report I am getting th