NESTED TYPE 사용 예제

제품 : SQL*PLUS
작성날짜 : 1999-05-27
NESTED TYPE 사용 예제
====================
. Nested table은 TABLE을 테이블의 컬럼으로 사용할 수 있도록 하는 데이터
타입이다.
. Nested table을 column으로 갖는 table을 parent table이라고 하고, parent
table이 갖고 있는 권한이나 storage option은 Nested table에 상속된다.
. nested table이 저장되는 segment를 storage table이라고 하고, nested table
선언시 지정해줘야 한다.
. 1: n의 관계나, master-detail과 같은 reference 관계에 유용한 데이터 타입이다.
nested table 컬럼을 처리하는데 다음과 같은 함수를 이용할 수 있다.
- CAST ()
untyped row들을 AS 이하에서 명시한 collection type으로 변환해 준다.
- MULTISET()
SELECT 결과가 여러 ROW를 담고 있을 때, 이들 ROW들을 하나의 데이터 SET으로
간주하여 처리할 수 있도록 해준다.
- THE()
Nested table의 하나의 요소를 처리할 때 사용 되는 함수이다.
- CURSOR()
subquery를 이용하여 임시 table을 구성할 때 사용. multi record를 return
할 수 있다.
< sample >
-- nested type 선언
SQL> create or replace type address as object
(street varchar2(80), city varchar2(80),
state char(2), zip varchar2(10));
SQL> create type address_nested_type as table of address;
SQL> create table address_nested_tbl
( empno number, address address_nested_type )
nested table address store as addresstab ;
-- inner table에 index 생성
SQL> create index add_nest_idx on addresstab (zip);
-- Insert
SQL> insert into address_nested_tbl values
(10, address_nested_type(
address('2 Avocet Drive', 'Redwood Shores', 'CA', '95055'),
address('55 Madison Ave', 'Madison', 'WI', '53715')));
SQL> insert into address_nested_tbl values
(20, address_nested_type(
address('55 Madison Ave', 'Madison', 'WI', '53715')));
SQL> insert into address_nested_tbl values (10, null );
-- inner table에 row 추가 (8.1이상에서 the 대신 table()도 가능)
SQL> insert into the (select address from address_nested_tbl
where empno =20 )
values (address('2 Avocet Drive', 'Redwood Shores',
'CA', '95055'));
-- Select
-- nested table에 저장된 object select하기
SQL> select empno, address from address_nested_tbl;
10 ADDRESS_NESTED_TYPE(
ADDRESS('2 Avocet Drive', 'Redwood Shores', 'CA', '95055'),
ADDRESS('55 Madison Ave', 'Madison', 'WI', '53715'))
20 ADDRESS_NESTED_TYPE(
ADDRESS('55 Madison Ave', 'Madison', 'WI', '53715') ,
ADDRESS('55 Madison Ave', 'Madison', 'WI', '53715'))
10
-- 개별 row select
-- table(), the() 유사한 기능 수행 => the()는 이후 없어질 예정
-- the()절 안에는 object가 바로 올 수 없고, subquery문 기술
-- detail row에 조건 주어 select
SQL> select p.empno,
cursor ( select street from table(p.address) a
where state ='WI') sta
from address_nested_tbl p where empno = 10;
10 CURSOR STATEMENT : 2
CURSOR STATEMENT : 2

Hello,
Which ABAP release are you working on?
When i use your code (on an ABAP 740 kernel) i get the following error message -
This is because the type is generic w.r.t the key. If you intend to use it in other types, you have to explicitly define the key for the table type.
Since I'm on ABAP release 740 so i can use the addition EMPTY KEY -
      tt_sflight TYPE STANDARD TABLE OF ty_sflight
                 WITH NON-UNIQUE EMPTY KEY.
If you are on previous releases i think you can use the addition DEFAULT KEY.
BR,
Suhas
PS - Further read: ABAP News for Release 7.40 - Internal Tables with Empty Key

Similar Messages

  • Known Issue: Serializable nested types result in an internal compiler error in "Release" built C#/VB UWP apps (Windows 10 Insider Preview SDK and tools, April 2015 release)

    If you have a type nested inside of a type deriving from a WinRT type, and the nested type is marked Serializable (such as with [DataContract]), your build will fail.
    This code will cause this failure.
        public sealed partial class MainPage : Page
            public MainPage()
                this.InitializeComponent();
                var d = new DataContractSerializer(typeof(MyData));
            [DataContract]class MyData { }

    Avoid serializable types nested inside of WinRT types.

  • Using nested types

    Sorry if this is the wrong forum
    I am having trouble understanding how to access oracle nested objects from my jdbc connection so would be greatful for any advice so thanks in advance. I want to do something like this :
    create type temp_bill_type as object
    ( id number(10)
    ) not final
    create type temp_gas_bill_type under temp_bill_type
    ( gas_supplier varchar2(20)
    create type temp_elec_bill_type under temp_bill_type
    ( elec_supplier varchar2(20)
    create type temp_bill_tab_type as table of temp_bill_type
    create type temp_account_type as object
    (id number(10)
    ,bill_tab temp_bill_tab_type
    create or replace procedure get_account(p_account out temp_account_type) is
    o_account temp_account_type;
    t_bill_tab temp_bill_tab_type;
    o_elec_bill temp_elec_bill_type;
    o_gas_bill temp_gas_bill_type;
    begin
    o_gas_bill:=new temp_gas_bill_type(id=>1,gas_supplier=>'Northen');
    t_bill_tab.extend();
    t_bill_tab(1):=o_gas_bill;
    o_elec_bill:=new temp_elec_bill_type(id=>2,elec_supplier=>'Eastern');
    t_bill_tab.extend();
    t_bill_tab(1):=o_gas_bill;
    o_account:=new temp_account_type
    (id => 1
    ,bill_tab => t_bill_tab
    p_account:=o_account;
    end;
    I have used jpublisher (via jdeveloper) to generate the custom classes for each type.
    I have used the options :
    Number Types : bigdecimal
    user types : oracle
    lob : oracle
    built ins : jdbc
    transative = n
    include methods = n
    omit schema = y
    This has generated the custom java classes which implement ORAData and ORADataFactory.
    In my java program I have put all the types on the hashMap
    So how do I access the sub types in billType class. I want to do something like this
    connection = this.getConnection();
    connection.setTypeMap(typeMap);
    statement = connection.prepareCall("{call get_account(p_account=>?) }");
    statement.registerOutParameter(1,TempAccountType._SQL_TYPECODE,TempAccountType._SQL_NAME);
    statement.execute();
    TempAccountType tempAccountType = (TempAccountType)statement.getObject(1, typeDTOMap);
    TempBillTabType tempBillTabType = tempAccountType.getBillTab();
    TempBillType tempBillType = tempBillTabType(1);
    if (tempBillType instanceof TempGassBillType) {
    //do some gas stuff
    }

    Ok .. i got around this issue myself ..
    For others who might have had to face the same problem, let me tell them the problem that i had... i ll b happy if it helps someone ...
    The issue was improper privleges of the Nested Types in the schema to which my server was connecting. Once proper privelges were given, everything started working just fine ...

  • Error when updating a multivalued property that contains nested types

    we cannnot update a CMS content that contains a multivalued property composed of nested types.
    our CMS content is made of a custom type "t4" and contains the following properties :
    - titre of type "String"
    - compose of type "t1" where t1 is a CMS type containing the property titre of type "String" and doc of type "Binary".
    we get the following stack trace when updating the "compose" property on the CMS document :
    com.bea.content.RepositoryRuntimeException: Error retrieving multivalued nested property via given beginning of indexedName: compose, please check for the complete and correct indexedName on the Property in question. at com.bea.content.Node.getProperty(Node.java:454) at com.bea.content.federated.internal.NodeManagerImpl.getStream(NodeManagerImpl.java:669) at com.bea.jsptools.content.node.properties.editor.BinaryEditor.getValues(BinaryEditor.java:134) at com.bea.jsptools.content.node.properties.editor.NestedPropertyEditor.getValues(NestedPropertyEditor.java:90) at com.bea.jsptools.content.node.properties.editor.NestedPropertyEditor.getValues(NestedPropertyEditor.java:90) at content.node.nodeSelected.properties.NodePropertiesController.saveProperty(NodePropertiesController.java:1018) at content.node.nodeSelected.properties.NodePropertiesController.saveProperties(NodePropertiesController.java:973) at content.node.nodeSelected.properties.NodePropertiesController.saveProperties(NodePropertiesController.java:768) at sun.reflect.GeneratedMethodAccessor524.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:854) at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:793) at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:463) at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:290) at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:338) at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:51) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:96) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2025) at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:90) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2096) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:550) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:838) at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:634) at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:156) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1177) at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:622) at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:140) at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:107) at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:99) at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:177) at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:165) at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:219) at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:179) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:351) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:361) at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:128) at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361) at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:339) at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:330) at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:162) at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:137) at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:370) at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:229) at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:183) at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:240) at com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java:574) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:273) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:292) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3191) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1979) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1886) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1317) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) Caused by: com.bea.content.RepositoryException: Error retrieving multivalued nested property via given beginning of indexedName: compose, please check for the complete and correct indexedName on the Property in question. at com.bea.content.internal.client.common.NestedHelper.getContainerIndex(NestedHelper.java:243) at com.bea.content.internal.client.common.NestedHelper.loopNested(NestedHelper.java:278) at com.bea.content.internal.client.common.NestedHelper.getNestedProperty(NestedHelper.java:162) at com.bea.content.internal.client.common.NestedHelper.getProperty(NestedHelper.java:102) at com.bea.content.internal.client.common.NestedHelper.getProperty(NestedHelper.java:126) at com.bea.content.Node.getProperty(Node.java:451) ... 98 more

    I was able to reproduce this issue in the beta also. The issue has since been fixed. For the time being, it looks like you can just clear (delete) that particular value and re-add it w/ the updated binary.

  • Error getting BinaryProperty with ShowDoc servlet on nested types

    Hi,
    We are trying to get a property with the ShowDoc servlet.
    The aim is to retrieve images stored as properties of CMS contents.
    That works fine for :
    - Text properties (for instance a title property) whatever they are in simple properties or part of nested types.
    - BinaryProperties if the property is not in a nested type and if we activa the stream property on the repository.
    That does not work if the property is inside a nested type.
    In our example , we've got a CMS content of type "edito". This typoe has a property called "sections" that is multivalued aand of type "section".
    The type "section" has a property called image of type Binary.
    The url we tried is :
    http://localhost:7001/Portal_WEB/ShowProperty?nodePath=/BEA%20Repository/PortailDSI/CISI-ACCUEIL/EDITOS/e5//sections[0].image
    it does not work and get the error whoed beside in trhe servlet result.
    Note : if we want to get another property on the "sections" that is not of type "Binary", it works fine. For example the following link works and retrieve the value of the property :
    http://localhost:7001/Portal_WEB/ShowProperty?nodePath=/BEA%20Repository/PortailDSI/CISI-ACCUEIL/EDITOS/e5//sections[0].image_title
    error from the servlet :
    com.bea.content.RepositoryRuntimeException: Error retrieving multivalued nested property via given beginning of indexedName: sections, please check for the complete and correct indexedName on the Property in question.
    at com.bea.content.Node.getProperty(Node.java:454)
    at com.bea.content.federated.internal.NodeManagerImpl.getStream(NodeManagerImpl.java:669)
    at com.bea.content.manager.servlets.ShowPropertyServlet.printNode(ShowPropertyServlet.java:311)
    at com.bea.content.manager.servlets.ShowPropertyServlet.doPost(ShowPropertyServlet.java:92)
    at com.bea.content.manager.servlets.ShowPropertyServlet.doGet(ShowPropertyServlet.java:84)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:273)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:292)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3191)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1979)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1886)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1317)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Just to clarify, when I said "The only workaround I can see is to only use the ShowDoc servlet on non-binary properties, or on binaries that are not defined as multivalued properties."
    Specifically this part "on binaries that are not defined as multivalued properties", I meant binaries that are not defined as multivalued nested properties, single valued nested properties that are binary will work.

  • Exception while using Nested types in Oracle

    Hi All,
    I am getting an exception while trying to use Nested types in Oracle. The same thing works in other systems. So it might be some problem with my configuration. Can anyone please help me out with this one. Thanks in advance..
    java.sql.SQLException: Internal Error
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1074)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1107)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:81)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:68)
    at oracle.sql.TypeDescriptor.initSQLName(TypeDescriptor.java:237)
    at oracle.sql.TypeDescriptor.getName(TypeDescriptor.java:198)
    at oracle.sql.StructDescriptor.getClass(StructDescriptor.java:1105)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:574)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:502)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:456)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBodyElements(OracleTypeCOLLECTION.java:1011)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81ImgBody(OracleTypeCOLLECTION.java:952)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:764)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearizeInternal(OracleTypeCOLLECTION.java:243)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:217)
    at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:891)
    at oracle.sql.ARRAY.getArray(ARRAY.java:315)
    at weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY.getArray(Unknown Source)
    Regards,
    Praveen G S

    Ok .. i got around this issue myself ..
    For others who might have had to face the same problem, let me tell them the problem that i had... i ll b happy if it helps someone ...
    The issue was improper privleges of the Nested Types in the schema to which my server was connecting. Once proper privelges were given, everything started working just fine ...

  • Problem with nested Types

    Hi!
    why is the 3th case failing???
    Map<K, Set<V>> map = new HashMap<K, Set<V>>();
    Map<K, Set<V>> test1 = map; //FINE
    Map<K, ?> test2 = map;     // FINE
    Map<K, Set<?>> test3 = map; //ERROR
    How can I define a function using the the second parameter as a set of any type?
    Thanks!
    Juergen

    jschmied70 wrote:
    I found
              Map<K, ? extends Set<?>> test4 = map; //FINE
    is working. But why do I have to write "? extends Set..." ?
    The elements in the Map should be exactly Sets, only the elements of the Sets are unknown.Because otherwise you'd loose the (increased) compile-time safety generics are all about.
    Your actual instance of a Map is constrained to accept only Set<V>'s as values. If the following were (compile-time) valid...
    Map<K, Set<V>> map = new HashMap<K, Set<V>>();
    Map<K, Set<?>> test3 = map;...then this would be too:
             test3.put(null, new HashSet<K>());df.

  • Nested Type consisting another table type!

    Hi,
    How can I achieve below type declarations?
    TYPES:BEGIN OF ty_scarr,
            carrid    TYPE scarr-carrid,
            carrname  TYPE scarr-carrname,
            currcode  TYPE scarr-currcode,
          END OF ty_scarr,
          BEGIN OF ty_sflight,
            carrid TYPE sflight-carrid,
            connid TYPE sflight-connid,
            fldate TYPE sflight-fldate,
            price  TYPE sflight-price,
          END OF ty_sflight,
          tt_sflight TYPE STANDARD TABLE OF ty_sflight.
    TYPES:BEGIN OF ty_result.
            INCLUDE TYPE ty_scarr.
            TYPES: sflight_tab TYPE tt_sflight,
          END OF ty_result.
    The above results in syntax error however below one works:
    TYPES:BEGIN OF ty_scarr,
            carrid    TYPE scarr-carrid,
            carrname  TYPE scarr-carrname,
            currcode  TYPE scarr-currcode,
          END OF ty_scarr,
          BEGIN OF ty_sflight,
            carrid TYPE sflight-carrid,
            connid TYPE sflight-connid,
            fldate TYPE sflight-fldate,
            price  TYPE sflight-price,
          END OF ty_sflight,
          tt_sflight TYPE ty_sflight OCCURS 0.
    TYPES:BEGIN OF ty_result.
            INCLUDE TYPE ty_scarr.
            TYPES: sflight_tab TYPE tt_sflight,
          END OF ty_result.
    Is there a way to achieve above without using "OCCURS 0" keyword as "OCCURS" keyword is not supported withing OO context?
    Thanks!

    Hello,
    Which ABAP release are you working on?
    When i use your code (on an ABAP 740 kernel) i get the following error message -
    This is because the type is generic w.r.t the key. If you intend to use it in other types, you have to explicitly define the key for the table type.
    Since I'm on ABAP release 740 so i can use the addition EMPTY KEY -
          tt_sflight TYPE STANDARD TABLE OF ty_sflight
                     WITH NON-UNIQUE EMPTY KEY.
    If you are on previous releases i think you can use the addition DEFAULT KEY.
    BR,
    Suhas
    PS - Further read: ABAP News for Release 7.40 - Internal Tables with Empty Key

  • What is the name of a nested parameterized type?

    The draft spec gives an example of a nested parameterized class Zipper<B> inside a parameterized class Seq<A>. In the sample code the nested type is refered to as Seq<String>.Zipper<Number>. Hence I concluded that the following should work either:
    package generics;
    public class RawTypes {
    private static class Outer<T> {
    public class NonstaticInner<T> {}
    public static void main(String[] args) {
    Outer[] x = new Outer<String>();
    Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
    Instead the compiler complains:
    incompatible types
    found : generics.RawTypes.Outer.NonstaticInner<java.lang.String>
    required: generics.RawTypes.Outer<java.lang.String>.NonstaticInner<java.lang.String>
              Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
    When I use the raw outer type the compiler is happy. Like in:
    Outer.NonstaticInner<String> var = x.new NonstaticInner<String>();
    But that is not what I want say.
    Why does this fail to compile? Because the outer class is a nested static class instead of a top-level class? That should not make a difference, I would think. What am I missing?
    Angelika

    I am quite surprised there is no reaction at your query.
    It made me so interested in the spec I downloaded it.
    At page 3 I read that no static meber could be parametrized.
    I think this makes the behaviour of the compiler correct.No, I don't think so. The spec says:
    "The scope of a type parameter is all of the declared class, except any static members or initializers, but including the type parameter section itself."
    The spec does not say that static members could not be parameterized. It just says that the type parameter of a generic class cannot be used in any static members of that generic class, be it a static method or a static initializer or the declaration of a static field or a nested static class.
    Stuff like this would be prohibited under the quoted wording:
    class X<T> {
    static T field;
    static T getField() { ... }
    static { T tmp; ... }
    static class Y { T t; }
    What I tried is not prohibited by anything in the spec, I believe. I simply defined a generic type (Outer) inside a nongeneric type (RawTypes):
    public class RawTypes {
    private static class Outer<T> {
    public class NonstaticInner<T> {}
    The weird thing is that the nested generic type RawTypes.Outer<T> behaves differently from a top-level generic type. Compare the above to the following:
    public class Outer<T> {
    public class NonstaticInner<T> {}
    According to the spec I would refer to the class nested into class Outer<T> as Outer<String>.NonstaticInner<Integer>, for instance. That's basically the example on page 4 of the spec, where they have a Seq<String>.Zipper<Number>.
    Why is the behavior entirely different when I want to refer to a class nested into RawTYpes.Outer<T>? Why can't I say RawTypes.Outer<String>.NonstaticInner<Integer>? Why do I have to name it RawTypes.Outer.NonstaticInner<Integer>? That does not make sense to me.
    A nested static type is like a top-level type, except that is has a name prefix. Why would that change with the addition of generics to the language?
    Outer.NonstaticInner<String> var = x.new
    NonstaticInner<String>();
    But that is not what I want say.What is it then that you want to say?
    Do you want to confine the valid values of var to outer classes parametrized with the
    String type? This will lead to problems (I think even with instances) as there is
    no specific type for a parametrized class.What error would you expect when a variable
    is passed having the correct "inner parameter type" but not the requested outer parameter type?I would expect the same error message that I would get when I assigned a Seq<String>.Zipper<Number> to a Seq<Integer>.Zipper<Number>. No?
    Maybe it's just a bug in the prototype compiler, but who can tell if the spec does not say much about nested types what their names would be.
    Angelika

  • JAXB problem to manage nested complex types

    Hi!
    I've defined a XSD schema to design a folder structure. So I created a complex type which contains a sequence of 'folder' type elements.
    The folder type element includes several elements and a final one which is another 'folder' type element.
    So it is easy to model a general folder structure, no matter the depth and length.
    When I compile it with JAXB to have an OO view I catch the following error:
    Nested type Folder hides an enclosing type
    The fragment of code which caused the error is:
    * Java content class for Folder complex type.
    * <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/C:/Progetti/folderschemaexample.xsd line 10)
    * <p>
    * <pre>
    * <complexType name="Folder">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <choice maxOccurs="unbounded" minOccurs="0">
    *         <element name="folder_name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    *         <element name="security" type="{}ACL"/>
    *         <element name="folder" type="{}Folder"/>
    *       </choice>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    */The error is raised when JAXB tries to compile a Folder interface as inner in another Folder interface (generated.Folder.Folder).
    Is any JAXB guru able to suggest me how to exit from this situation to create succesfully a JAXB compliant schema which models this folder structure?
    TIA

    Hi!
    I've defined a XSD schema to design a folder structure. So I created a complex type which contains a sequence of 'folder' type elements.
    The folder type element includes several elements and a final one which is another 'folder' type element.
    So it is easy to model a general folder structure, no matter the depth and length.
    When I compile it with JAXB to have an OO view I catch the following error:
    Nested type Folder hides an enclosing type
    The fragment of code which caused the error is:
    * Java content class for Folder complex type.
    * <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/C:/Progetti/folderschemaexample.xsd line 10)
    * <p>
    * <pre>
    * <complexType name="Folder">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <choice maxOccurs="unbounded" minOccurs="0">
    *         <element name="folder_name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    *         <element name="security" type="{}ACL"/>
    *         <element name="folder" type="{}Folder"/>
    *       </choice>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    */The error is raised when JAXB tries to compile a Folder interface as inner in another Folder interface (generated.Folder.Folder).
    Is any JAXB guru able to suggest me how to exit from this situation to create succesfully a JAXB compliant schema which models this folder structure?
    TIA

  • UserDefined Type Question - Nested Table Attribute

    I have a question about some types I'm trying to create and whether or not it's even possible .....
    Here's the background ...
    I have the following type i created :
    create type asset_stat (
    stat_current varchar2(50),
    stat_change_date date,
    stat_change_user varchar2(30)
    All this type does is simply put a user and date/time stamp when constructed. I want to track status changes for historical tracking.
    Then I want to create a nested table type of the above type as follows:
    create type asset_stat_nt as table of asset_stat
    Then, I have another type i've created which will have the nested table type created above as an attribute.
    create type asset (
    asset_name varchar2(30),
    asset_type varchar2(3),
    asset_stat asset_stat_nt
    Now, the constructor for this asset type is defined like this: ( this is where i get lost)
    constructor function asset (
    asset_nm IN varchar2,
    asset_type_cd in varchar2,
    asset_stat_cd in varchar2 ) return self as result is
    begin
    self.asset_nm := asset_nm
    self.asset_type := asset_type_cd ;
    self.asset_stat := asset_stat_nt(asset_stat_cd);
    return;
    end;
    I just created a table of asset type and tried to do an insert and I'm getting an error related to the line where the nested type is being assigned. Is this possible? If so is my syntax completely off? I'm not quite sure how to set values for the nested type because i want to keep all records of change. Any help would be greatly appreciated.
    thanks

    the block of code shows that asset_stat_nt is the type assigned to asset_stat inside the type asset as shown below
    create type asset (
    asset_name varchar2(30),
    asset_type varchar2(3),
    asset_stat asset_stat_nt
    I guess for the following block of code, the line with the arrows should be given like shown below in bold letters
    constructor function asset (
    asset_nm IN varchar2,
    asset_type_cd in varchar2,
    asset_stat_cd in varchar2 ) return self as result is
    begin
    self.asset_nm := asset_nm
    self.asset_type := asset_type_cd ;
    self.asset_stat := asset_stat_nt(asset_stat_cd);return;
    end;
    [b][b]self.asset_stat := asset(asset_stat_nt(asset_stat_cd));
    I am not pretty sure.......try it anyway.....if it works....good to you

  • Nested-Generic Type with the same parameter as enclosing type?

    Greetings. I want to write a nested generic type with the same type parameter as the enclosing type. For example, consider:
    public interface BinaryTree<Type> {
         Node<Type> getRoot();
         interface Node<Type> {
              Type getValue();
              void setValue(Type value);
              Node<Type> getLeft();
              void setLeft(Node<Type> node);
              Node<Type> getRight();
              void setRight(Node<Type> node);
    }In this example, I want Node to be specified to the same type as the binary tree's parameter specification. Does anyone know how to do that? I have tried several methods and am at a loss.
    TIA

    Is there any way to declare that? Essentially I want
    the nested type to parameterize the enclosing type.I understand that but I don't think it's possible because of how java generics works.
    This ,
    SomeClass< SomeNestedClass<Type> >is wrong because you're supposed to give a formal type parameter within <> not an already defined type (like SomeNestedClass).
    If you instead do
    public class SomeClass<Type > {
        public static class SomeNestedClass<Type> {
    }To think of the two Type as the same formal type parameter is semantically incorrect. Both the outer type and the inner type must be able to participate in variable declarations "on their own". Say you do
    SomeClass<Integer> sc;Just because you did the above in which context is now SomeNestedClass supposed to be bound as SomeNestedClass<Integer>? To me this shows that SomeClass and SomeNestedClass cannot share the same formal type parameter.

  • JAXB - nested elements of same name

    Hi
    I have a schema which can represent elements with identical nested names like this:
    <Simple>
    <Strong>
    <Simple/>
    </Strong>
    </Strong>
    The nesting is not recursive. i.e. the two 'Simple' elements are not actually identical. Unfortunately when I bind the schema to java using JAXB, the generated code won't compile and i get error due to name collision:
    "Nested type SimpleType hides an enclosing type"
    Can external binding fix this problem? I have already tried it but without success because there doesn't seem to be a way to bind the 'SimpleType' to another name. I can only change the interface name, but i need to change the type interface as well.
    I am tearing my hair about it and only solution i can see is that i use XSLT to transfrom the names before reading the XMl files in and writing them out. I can not change the original schema unfortunately.
    Any clues will be much appreciated, Martin.

    Hi everybody
    In the interest of anyone having similar problem, i have discovered that if i used a schema which used complex types explicitly (as generated by XmlSpy for me) the problem went away. This is probably because the nesting becomes irrelevant. My original schema contained only one element with all the types being anonymous and nested within that element.
    Regards, Martin.

  • JDWP reference implementation does not return anonymous nested classes?

    Using
    $ java -version
    java version "1.6.0_22"
    Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
    Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
    it appears that when I connect with JDWP and issue a NestedTypes command, the result does not include anonymous nested types. The only references to this that I could find is a comment in a svn commit at apache (http://mail-archives.apache.org/mod_mbox/harmony-commits/200611.mbox/%[email protected]%3E)
    Is this intentional and desired? Is there a way to get all of the nested types, including the anonymous ones? I could do ClassesBySignature with "package.ClassName$*" as the signature and filter out doubly nested classes, but that seems overly complicated.

    exept, you can NOT have an implementation of an
    abstract class (which foundPlugin) is without an
    implementation of all it's subclasses (such as
    argsObject) You're mistaken in a couple of ways here.
    First, a nested class is not the same as a subclass.
    Second, a concrete class must have implementations for all its methods, but it can still have an abstract nested class.
    Third, you can have an instance of a concrete class that has abstract subclasses. Object is concrete and has many concrete subclasses. Classes don't know anything about their subclasses.
    This compiles.
    public abstract class AbOut {
      public abstract class AbIn {  public abstract void bar(); }
    public class ConcOut extends AbOut {
      public abstract class AbIn2 { public abstract void foo();}
    foundPlugin MUST have an implementation
    of argsObject, according to the rules of java,And you think this because...?
    You read it in the JLS? Citation please.
    You tried to compile and it failed? My sample above demonstrates the countereample. If I'm misunderstanding what you're talking about, please post an example
    Or maybe you just thought it had to be that way because that seemed the most intuitive and when it wasn't, rather than trying to understand or adjust your thinking, you figured it would be more fun to throw a hissy fit and call Java "stupid"?

  • How to ensure multiple nested classes static readonly initialization orders

    Hello,
    I am emulating the Java Enumeration in a first class class, with static readonly field initialization.
    In an effort to further categorize some instances, I embed them in nested classes. Something like this.
    class A : Enumeration
    public static class CatB
    public static readonly A FirstInstance = new B();
    public static readonly A SecondInstance = new B();
    public static class CatC
    public static readonly A ThirdInstance = new C();
    public static readonly A FourthInstance = new C();
    class B : A
    class C : A
    So far so good.
    One strain of Enumeration has built-in Ordinals, so I initialize them in the static ctor, or I make an effort to.
    static A()
    var values = GetValues().ToList();
    var ordinal = 0;
    values.ForEach(v => v.Ordinal = ++ordinal);
    Also, in places, so far so good.
    However, in a main method, I am referencing one of the enumerated instances, so calls to my GetValues() is returning nulls for that nested class. The other nested class instances are just fine, they return just fine.
    I could post more, but I think this illustrates the idea.
    I am suspicious that a strange static initialization order is jumbled up, as evidenced by nested static ctor debug statements I put in. I get one print and not the other.
    When I switch up which instance I reference in my main, I get the opposite behavior, more or less confirming my suspicions.
    So... Question is, what's the best way to potentially work around this issue? Hopefully without abandoning the Enumeration concern altogether, but that thought is a possibility as well. Or at least do so differently.
    Thank you...

    It is probably necessary to show GetValues() at least. I am getting the correct nested types, so that much we can at least assume.
    protected static IEnumerable<TDerived> GetValues()
    var declaringTypes = GetDeclaringTypes(typeof (TDerived)).ToArray();
    foreach (var declaringType in declaringTypes.Reverse())
    var fis = declaringType.GetFields(PublicStaticDeclaredOnly);
    var values = fis.Select(fi => fi.GetValue(null)).ToArray();
    foreach (var value in values.OfType<TDerived>())
    yield return value;
    Okay, here a bit of explanation.
    Enumeration is declared generically, with TDerived as the derived type. In this case, A.
    GetDeclaringTypes is operating okay. I get types for A, B, and C.
    The fis to values is breaking down, however. When I reference any of the CatB's, I get nulls for those instances. Conversely, same for CatC's when I reference any of those.

Maybe you are looking for

  • Ending a process chain with abap program

    Hello friends. Can anyone help me please? I have a problem with a process chain in BW. The process chain is triggered by the MF BP_EVENT_RAISE in an custom MF. While the process chain works, the custom MF is monitoring the chain´s log. This process c

  • Transporting objects ? Please suggest

    We have a landscape of DEV, QA & PROD for BI & R/3. So how will the objects move from DEV to PROD, is it from DEV to QA and QA to PROD (OR) DEV to QA and DEV to PROD. Please suggest me the clear process of transportation of BI Objects from DEV to PRO

  • After Yosemite install Symantec AV LiveUpdate won't run citing Java RTE not found error even after install of Java 8 Update 25

    I just installed Yosemite.  When I attempted to run Symantec Anti-Virus LiveUpdate (which worked fine under Mavericks) I got an error message stating "LiveUpdate was cancelled because Java Runtime was not found. Please run LiveUpdate once Java has be

  • Screen Control for Maintenace Order

    Dear Sir, Can You Tell Me SPRO Path For Field Referance for Maintenace Order ? I am Going to change Screen Referance For the Maintenance  order Type wise. for ex- For Order type PM10- There is no necessary of investment tab page But For PM70 Project

  • I NEED HELP! IPOD AND ALBUM ARTWORK ISSUES

    I can use the music store and surf the internet fine. BUT, I try to use the ministore and with the new itunes, update mmy ipod and download album artowrk, it says itunes cannot connect, please make sure my connection is active. I tried the network di