Choose a type of object such as a table rather than as an object

It is possible to select a type of object in a table? For example if I have an object Foo with a REF for Bar, querying for Bar returns this:

Select DEREF (bar_ref) from foo_objtab

Deref (bar_ref)
------------------------------------------
TEST. BAR (123, 456)
TEST. BAR (123, 456)
TEST. BAR (123, 456)
TEST. BAR (123, 456)


For purposes of compatibility with a wrapper of ADO.NET, I need to return the objects as if they were columns of the table, like this:

COL1, COL2
------------------------------------------
123, 456
123, 456
123, 456
123, 456


Is this possible? I tried different combinations of FONT, TABLE and DEREF and have failed.

AWK says:
Is this possible? I tried different combinations of FONT, TABLE and DEREF and have failed.

Just the suffix DEREF with attribute name:

SQL> create or replace
  2    type t_obj as object (
  3                          id number,
  4                          name varchar(200)
  5                         )
  6  /

Type created.

SQL> create table t_obj_tbl of t_obj
  2  /

Table created.

SQL> create table t_list_tbl(
  2                          t_obj_ref ref t_obj
  3                         )
  4  /

Table created.

SQL> insert into t_obj_tbl
  2  values(1,'A')
  3  /

1 row created.

SQL> insert into t_obj_tbl
  2  values(2,'B')
  3  /

1 row created.

SQL> insert into t_list_tbl
  2  select  ref(t)
  3    from  t_obj_tbl t
  4  /

2 rows created.

SQL> commit
  2  /

Commit complete.

SQL> select  deref(t_obj_ref)
  2    from  t_list_tbl
  3  /

DEREF(T_OBJ_REF)(ID, NAME)
--------------------------------------------------------------------------------
T_OBJ(1, 'A')
T_OBJ(2, 'B')

SQL> select  deref(t_obj_ref).id id,
  2          deref(t_obj_ref).name name
  3    from  t_list_tbl
  4  /

        ID NAME
---------- ----------
         1 A
         2 B

SQL> 

SY.

Tags: Database

Similar Questions

  • STD R2 Windows Server 2012 was working fine this morning by restarting the server now, we get the error, choose your type of keyboard

    STD R2 Windows Server 2012 was working fine this morning by restarting the server now, we get the error to Choose your type of keyboard

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • In Win 2012 R2 server, choose your type of keyboard

    Hi all

    I use WindowsServer 2012 R2 std while restarting the server right now there getting error Choose your type of keyboard,

    So please guide me how to solve this problem.

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • If I try to type a name such as my videos in the address bar in my computer and press ENTER, it will not open.

    To the right:

    My name is Andrew Wissler. I have a Dell Inspiron 6000 running a 32-bit version of Windows XP Media Center with Windows Service Pack 3.  I'm having a problem where if I try to type a name such as my videos in the address bar in my computer and press ENTER, it will not open.  Instead, Windows Internet Explorer opens and a Google search results page comes up with the search term in the search box and results are presented.  Is it possible that I can enter the term into the address bar and open the folder?

    Thank you

    Andrew

    Hi André,.

    This is the default behavior. You will need to type the full path of the folder my videos to open in Windows Explorer. To do this, try the following steps:
    a. Click Start, click my computer.
    b. in the address bar, type the following and press ENTER: Shared Documents\My videos

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Exception of the UI by clicking provisioned resource... Houston-25003: LDAPUserForm1UD_LDAP_GRPVO object of type View object is not found

    Hi all

    Under the tab accounts for a user, whenever I click on the resource brought online, I get the following error on the user interface.

    Messages for this page are listed below.

    Error

    Houston-25003: LDAPUserForm1VO object of type View object is not found.

    Error

    Houston-25003: LDAPUserForm1UD_LDAP_GRPVO object of type View object is not found.

    Error

    oracle.jbo.NoObjException: Houston-25003: LDAPUserForm1UD_LDAP_GRPVO object of type View object is not found.

    Error

    Localized message is not available.  Error returned is: oracle.jbo.NoObjException: Houston-25003: LDAPUserForm1UD_LDAP_GRPVO object of type View object is not found.

    I understand that LDAPUserForm1UD_LDAP_GRPVO is the name of the child form to the resource of the LDAP user. While they inspected the child form, I find this design console.


    LDAPUserForm1VO is the form created for the LDAP instance. SDM export shows that this exists in the location "oracle\iam\ui\runtime\form\view\pages\mdssys\cust\site\site\LDAPUserForm1CreateForm.jsff.xml".


    In addition, if I try to create a new form for this Instance of the Application, it fails with the exception:


    • oracle.jbo.NoDefException: Houston-25002: definition of the type of the view definition sessiondef.oracle.iam.ui.runtime.form.model.LDAPUserVersion6.view.LDAPUserVersion6UD_LDAP_ROLVO is not found.



    While I can see the error, I'm not able to find a solution to what for what is absent and where!

    Clues from anyone, which was faced with this or at least help troubleshooting would be great.

    -Thank you,

    Def-ender

    If your sandboxes have the elements of form generation on the side of the administration of the system, then most likely you have replaced a sandbox created after the publication by a prior created sandbox which does not contain the information from the form in the file CatalogAM.xml. I think that's the name. To oracle support site, there are best practices sandbox offline that you can search. I'm restoring your mds changes and then recreate these forms and publish every sandbox in order before new forms are created.

    -Kevin

  • Need help to identify the type of object in the loop of pl/sql

    Hello

    I need help to identify the Type of object declared beneath a procedure as shown below:

    I need to pass the parameter to the procedure as a TYPE of OBJECT and also refer to variables of Type Object in a loop

    create or replace type TEST_VALIDATION_REC is RECORD (order_num varchar2 (30),)

    number of inventory_item_id

    reserved_YN varchar2 (1).

    error_flag varchar2 (1).

    Error_message varchar2 (2000)

    );

    CREATE OR REPLACE TYPE VALD_TBL AS VARRAY (10000) OF TEST_VALIDATION_REC;

    PROCEDURE ADD_TO_ORD)

    p_lot_number_list IN VALD_TBL,

    p_ord_number IN Varchar2,

    p_user_id in NUMBER: = fnd_profile.value ('USER_ID'),-change 1.10

    p_responsibility_id in NUMBERS: = fnd_profile.value ('RESP_ID'),-change 1.10

    p_application_id IN VARCHAR2: = 'PO',-change 1.10

    x_error_flag OUT Varchar2,

    x_error_msg OUT Varchar2

    )

    In the above procedure, I had the VALD_TBL. Is it OK?

    And how in the loop if the records if I use:

    FOR indx1 IN 1.p_lot_number_list. COUNTY

    LOOP

    BEGIN

    SELECT

    inventory_item_id

    IN

    ln_item_id

    Of

    dummy_lot_tab

    WHERE

    lot_number = p_lot_number_list (indx1); - > how direct the item here?

    EXCEPTION

    WHILE OTHERS THEN

    ln_item_id: = NULL;

    END;

    Records are PL/SQL objects.  They are not the SQL objects.  You can create a SQL TYPE (schema level) as a collection (variable-tables only, tables nested).

    So therefore your first statement is syntactically incorrect

    CREATE OR REPLACE TYPE TEST_VALIDATION_REC IS RECORD
    (order_num VARCHAR2(30),
    inventory_item_id NUMBER,
    reserved_YN VARCHAR2(1),
    error_flag VARCHAR2(1),
    Error_message VARCHAR2(2000)
    );
    

    You must put in an anonymous PL/SQL block or the stored procedure

    DECLARE
    
       TYPE test_validation_rec IS RECORD
       (
        order_num VARCHAR2(30),
        inventory_item_id NUMBER,
        reserved_YN VARCHAR2(1),
        error_flag VARCHAR2(1),
        error_message VARCHAR2(2000)
       );
    
       TYPE vald_tbl iS VARRAY(10000) OF test_validation_rec;
    
       lv_tbl vald_tbl;
    
    BEGIN
    
       lv_tbl := vald_tbl();
      -- insert your code here 
    
    END;
    
  • expdp hangs at "type of object DATABASE_EXPORT/DIAGRAM/PROCEDURE/ALTER_PROCEDURE processing."

    Hello world

    Help, please

    Database Oracle 11.2.0.3 on AIX 6.1 os

    SQL > show the compatible parameter

    VALUE OF TYPE NAME

    ------------------------------------ ----------- ------------------------------

    compatible string 11.2.0.3.0

    expdp system full = y exclude = statistics... crashes

    [...]

    DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC processing object type

    Treatment of type of object DATABASE_EXPORT/SCHEMA/PACKAGE/SCHOLARSHIP/OWNER_GRANT/OBJECT_GRANT

    Treatment of type of object DATABASE_EXPORT/SCHEMA/PACKAGE/SCHOLARSHIP/CROSS_SCHEMA/OBJECT_GRANT

    DATABASE_EXPORT/SCHEMA/FEATURE/FUNCTION processing object type

    Treatment of type of object DATABASE_EXPORT/SCHEMA/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT

    Treatment of type of object DATABASE_EXPORT/SCHEMA/FUNCTION/GRANT/CROSS_SCHEMA/OBJECT_GRANT

    DATABASE_EXPORT/DIAGRAM/PROCEDURE/PROCEDURE processing object type

    Treatment of type of object DATABASE_EXPORT/DIAGRAM/PROCEDURE/GRANT/OWNER_GRANT/OBJECT_GRANT

    Treatment of type of object DATABASE_EXPORT/DIAGRAM/PROCEDURE/GRANT/CROSS_SCHEMA/OBJECT_GRANT

    Treatment of type of object DATABASE_EXPORT/SCHEMA/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC

    DATABASE_EXPORT/SCHEMA/FUNCTION/ALTER_FUNCTION processing object type

    DATABASE_EXPORT/DIAGRAM/PROCEDURE/ALTER_PROCEDURE processing object type

    Current waiting for the working session: db file sequential read

    Help, please. Google doesn't help

    Post pl in Export/Import forum - https://community.oracle.com/community/database/oracle-database-options/export_import_sql_loader_%26_external_tables

  • What is the type of object to use for virtual machine model in the Points of Extension?

    Hello

    I added my plugin point of extension vsphere.core. ${objectType} .monitorViews. My plugin is for all types of objects (vm, file, vApp, resourcePool, etc) except the model of the virtual machine. My understanding is that the vm object type would be required for the virtual machine template, but that doesn't seem to be the case. Am I missing something here? Should the plugin appear for the model of the virtual machine when I use the vsphere.core.vm.monitorViews extension point?

    Thanks in advance.

    Kind regards

    Ashutosh

    Sorry, I got confused by your original question. ExtensionPoint id you are looking for is the one for adding views a model virtual machine monitor tab:

    model.monitorViews vSphere.Core.

  • How do to identify what type of object it is?

    Hello

    I have an abc.upd_abc name.

    I would like to know what type of object it was.

    I've used the below query but no row returned.

    I connected as sys.

    Select object_type from dba_objects where object_name = 'abc ';

    Can someone guide me on this.

    Thank you.

    must be capital letters.

    object_name = 'ABC ';

  • How to change the type of object?

    I have an object type, as shown below:

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );

    create or replace type test_type1 is table of the test_object1;


    Now I want to change the type of object. I want to increase the size of val1 to varchar2 (100).

    Any body could help for the alter script.

    Thank you
    Lavan

    >
    SQL > alter type test_object1 change attribute (varchar2 (100)) val1;
    >
    Which won't work OPs example. Your example does not include the second type of object that depends on the first type.

    You cannot change the underlying type unless you use the CASCADe or INVALIDATE option.
    >
    change the type of test_object1 change attribute (val1 varchar2 (100)) waterfall;
    >
    See the CASCADE clause in the link provided by Osame
    >
    CASCADE clause

    Specify the CASCADE clause if you want to propagate the type change to the tables and dependent types. Oracle database abandons the statement if errors are found in the dependent types or tables, unless you also specify the FORCE.

    If you change the property of the type between FINAL and NON-FINAL, you must specify this clause to convert data in the tables and dependent columns. Please refer to [NOT] FINAL.

  • Choose OS type when creating the VM

    Someone asked me a question that I knew exactly how to respond. Before an ins OS installed, are there differences between the underlying infrastructure of VM or just architecture by choosing different types of BONES.

    I couldn't think of what these differences would be as appropriate.

    Select the operating system type from my understanding is more oriented around what tools VMware get fitted for installation.

  • [CS2] [VB] How can I determine the type of object to a PageItem?

    I use InDesign CS2 and VBScript

    Loop to the bottom of the PageItems in a Page, I need determine the Type of object (TextFrame, group, GraphicLine... each process) and PageItem accordingly.

    Is there a method/function VBS wiil returns the Type of an object as a string or a value. Or what I need to check the existence/non-existence of a particular property associated with a particular object for this type?

    Alternatively, is there a JavaScript function that will do what I can call VBScript?

    For the record: TypeName is what you need.

    For example, when the cursor is planted in the text return TypeName (Ind.Selection (1)) 'PointInsertion.' When a text block is selected, it returns "TextFrame.

  • Need help on the types of objects

    Hello Mr President

    I have one overlay out attributes and the value of the attributes

    DECLARE
    p_user_name_o VARCHAR2 (200);
    p_user_attributes_so manoj_tab_type;

    BEGIN
    p_user_name_o: = Maury
    xxcss_user.getuserattributes (p_user_name_o,
    p_user_attributes_so
    );

    IF (p_user_attributes_so. THERE ARE (1))
    THEN
    BECAUSE me IN p_user_attributes_so. FIRST... p_user_attributes_so. LAST
    LOOP
    Dbms_output.put_line ('attribute ='
    || p_user_attributes_so (i). ATTRIBUTE
    || '; Attribute value ='
    || p_user_attributes_so (i) .attribute_value
    );

    END LOOP;
    END IF;


    END IF;
    END;

    This wrapper will take the username as input and will give you all the attributes of username as the id, USERNAME, ADDRESS, LOCATION of the customer name

    I wanted to shoot only address and location of the envelope above.

    manoj_tab_type is an array of a type of object type

    Can you suggest me how to extract the address and location of theabove packaging. I wanted to print values

    Appreciate your help on the above

    Thanks and greetings
    Manoj Thakur R

    Just add an if STATEMENT stmt in the loop...

    FOR i IN p_user_attributes_so.FIRST .. p_user_attributes_so.LAST
    LOOP
     if p_user_attributes_so.ATTRIBUTE = 'ADDRESS' or p_user_attributes_so.ATTRIBUTE = 'LOCATION' then
       DBMS_OUTPUT.put_line ( 'Attribute='|| p_user_attributes_so.ATTRIBUTE|| '; Attribute Value='|| p_user_attributes_so.attribute_value);
     end if;
    END LOOP;
    

    HTH.

  • With the help of a user defined type as a return type of function with a type of object

    Hi, I created my own data type of table I want to use as data type back to a member function of an object type that I created.

    I work in an environment of 10g.

    The code I used looks like this:

    create or replace
    Dim p As Package as

    type p_rec is (number of v1);
    type p_tab is table of the p_rec;

    end p;
    /

    CREATE or REPLACE TYPE p_ot () AS OBJECT

    / * some statements * /.

    NO DEFINITIVE MEMBER FUNCTION p.p_tab RETURN foo

    );
    /


    When I try to compile p_ot I get an error: Error (5.40): PLS-00201: identifier 'P.P_TAB' must be declared.

    I don't know the syntax is correct so I must be missing something, amy hepl would be great.

    See you soon

    You can define types of objects

    create type p_rec as object ( v1 number );
    create type p_tab as table of p_rec;
    

    They can be used inside the package (p) in your example) as well as defined in the package.
    In this case, there will be no problems with create type

    CREATE TYPE p_ot AS OBJECT (
    
    /* some declarations*/
    
    NOT FINAL MEMBER FUNCTION foo RETURN p_tab
    );
    
  • Ask about the types of objects

    Hello

    I have a question about the type of object. I want to see the script for the type of object created, that is already stored in the database. How can I see who


    Concerning

    Hello

    So, you can try [DBMS_METADATA. GET_DDL | http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_metada.htm#ARPLS640]...

    MHO%xe> create or replace type mytype as object( col varchar2( 10 ));
      2  /
    
    Type is aangemaakt.
    
    Verstreken: 00:00:00.37
    MHO%xe> select dbms_metadata.get_ddl('TYPE', 'MYTYPE') from dual;
    
    DBMS_METADATA.GET_DDL('TYPE','MYTYPE')
    ------------------------------------------------------------------------------
    
      CREATE OR REPLACE TYPE "MHO"."MYTYPE" as object( col varchar2( 10 ));
    

Maybe you are looking for