Import tables with nested table : ORA-00600
In Oracle 9.2
Create object, type as table, and table with nested table (store as syms_ntab) are successfully.
Also its export.
In process of import on another server (also 9.2, 'fromuser=one touser=two') shows errors:
. . importing table "SYMS_NTAB"
IMP-00058: ORACLE error 600 encountered
ORA-00600: internal error code, arguments: [kokeeafi1], [2], [2], [], [], [], [], []
IMP-00075: Warning: The nested table may contain partial rows or duplicate rows
But for all that table is created and error occur on phase inserting strings.
What is this?
In Oracle 8.0.5 i perform similar operation without error.
From Oracle error messages and codes manual:
ORA-00600 internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
Cause: This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include:
* timeouts
* file corruption
* failed data checks in memory
* hardware, memory, or I/O errors
* incorrectly restored files
The first argument is the internal message number. Other arguments are various numbers, names, and character strings. The numbers may change meanings between different versions of Oracle.
Action: Report this error to Oracle Support Services after gathering the following information:
* events that led up to the error
* the operations that were attempted that led to the error
* the conditions of the operating system and databases at the time of the error
* any unusual circumstances that occurred before receiving the ORA-00600 message
* contents of any trace files generated by the error
* the relevant portions of the Alter files
Note: The cause of this message may manifest itself as different errors at different times. Be aware of the history of errors that occurred before this internal error.
Similar Messages
-
Partition exchange error on table with nested table
On Oracle 11.2.0.1, I have a partitioned table with some partitions that need to be 'archived' (in terms of moving partitions to an 'archive' table).
I have a source table like:
CREATE TABLE IS_PODACI245
ID_OBJEKTA_IDENTIFIKACIJA NUMBER(10),
ID_OBJEKTA NUMBER(20),
DATUM TIMESTAMP(6) NOT NULL,
TZ NUMBER(3),
DATA1 NUMBER(10),
DATA2 NUMBER(6),
DATA3 NUMBER(10),
DATA4 NUMBER,
DATA5 T_NTCIP_CLIMATE_TABLE
NESTED TABLE DATA5 STORE AS IS_PODACI245_STORE_TABLE
TABLESPACE DATA
PARTITION BY RANGE (DATUM)
PARTITION P_201107 VALUES LESS THAN (TIMESTAMP' 2011-08-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE DATA,
PARTITION P_MAXVALUE VALUES LESS THAN (MAXVALUE)
LOGGING
NOCOMPRESS
TABLESPACE DATA
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE INDEX IDX_IS_PODACI245_KOMPLEKS ON IS_PODACI245
(ID_OBJEKTA_IDENTIFIKACIJA, ID_OBJEKTA, DATUM)
TABLESPACE DATA
LOCAL (
PARTITION P_201107
LOGGING
NOCOMPRESS
TABLESPACE DATA,
PARTITION P_MAXVALUE
LOGGING
NOCOMPRESS
TABLESPACE DATA
NOPARALLEL;
CREATE OR REPLACE TYPE t_ntcip_climate_table as table of t_ntcip_climate_fmt;
CREATE OR REPLACE TYPE t_ntcip_climate_FMT as object
( dev_index number(6)
, dev_description varchar2(512)
, dev_type number(10)
, dev_status number(10)
, dev_mfr_status varchar2(512)
, dev_active number(3)
, dev_test_activation number(10)
/I would like to make exchange partition using stage table, and everything is going fine on all tables, but only on a few of them (listed source is one of them, and they're only tables with nested tables wihin), where I get an error.. but sometimes ;)
on a statement like:
ALTER TABLE IS_PODACI245_ARH EXCHANGE PARTITION P_201106 WITH TABLE IS_PODACI245_STAGE EXCLUDING INDEXES WITHOUT VALIDATION;I got an error:
ORA-00001: unique constraint (TXV.SYS_C0032911) violated
it's an unique index between parent and nested table.
what could cause that problem?Dear,
I suppose that the unique constraint
ORA-00001: unique constraint (TXV.SYS_C0032911) violatedis the one you 've created on the nested table IS_PODACI245_STORE_TABLE
If so, why not disable that constraint and try again.
I have never exchanged such a kind of partitioned table having a nested table in it. But, I could imagine that the cloned non partitioned table IS_PODACI245_STAGE should at least be the exact image of the partitioned table IS_PODACI245_ARH (of course without the partition part) but with the nested table part and including all indexes
In addition, if you have a parent/child relationship between your partitioned tables, then there is a chronological order of exchange starting by the child and then finishing by the parent
see the following link for more information about this order of exchange (and comment 2 for an example also)
http://jonathanlewis.wordpress.com/2006/12/10/drop-parent-partition/#more-65
Hope this helps
Mohamed Houri -
Data pump import error with nested tables
So the problem is somewhat long :)
Actually the problems are two - why and how oracle are treating OO concept and why data pump doesn't work?
So scenario for the 1st one:
1) there is object type h1 and table of h1
2) there is unrelated object type row_text and table of row_text
3) there is object type h2 under h1 with attribute as table of row_text
4) there is table tab1 with column b with data type as table of h1. Of course column b is stored as nested table.
So how do you think - how many nested tables Oracle will create? The correct answer is 2. One explicitly defined and one hidden with system
generated name for the type h2 which is under type h1. So the question is WHY? Why if I create an instance of supertype Oracle tries to adapt
it for the subtype as well? Even more if I create another subtype h3 under h1 another hidden nested table appears.
This was the first part.
The second part is - if I do schema export and try to import it in another schema I got error saying that oracle failed to create storage table for
nested table column b. So the second question is - if Oracle has created such a mess with hidden nested tables how to import/export to another
schema?
Ok and here is test case to demonstrate problems above:
-- creating type h1 and table of it
SQL> create or replace type h1 as object (a number)
2 not final;
3 /
Type created.
SQL> create or replace type tbl_h1 as table of h1;
2 /
Type created.
-- creating type row_text and table of it
SQL> create or replace type row_text as object (
2 txt varchar2(100))
3 not final;
4 /
Type created.
SQL> create or replace type tbl_row_text as table of row_text;
2 /
Type created.
-- creating type h2 as subtype of h1
SQL> create or replace type h2 under h1 (some_texts tbl_row_text);
2 /
Type created.
SQL> create table tab1 (a number, b tbl_h1)
2 nested table b
3 store as tab1_nested;
Table created.
-- so we have 2 nested tables now
SQL> select table_name, parent_table_name, parent_table_column
2 from user_nested_tables;
TABLE_NAME PARENT_TABLE_NAME
PARENT_TABLE_COLUMN
SYSNTfsl/+pzu3+jgQAB/AQB27g== TAB1_NESTED
TREAT(SYS_NC_ROWINFO$ AS "GINTS"."H2")."SOME_TEXTS"
TAB1_NESTED TAB1
B
-- another subtype of t1
SQL> create or replace type h3 under h1 (some_texts tbl_row_text);
2 /
Type created.
-- plus another nested table
SQL> select table_name, parent_table_name, parent_table_column
2 from user_nested_tables;
TABLE_NAME PARENT_TABLE_NAME
PARENT_TABLE_COLUMN
SYSNTfsl/+pzu3+jgQAB/AQB27g== TAB1_NESTED
TREAT(SYS_NC_ROWINFO$ AS "GINTS"."H2")."SOME_TEXTS"
SYSNTfsl/+pz03+jgQAB/AQB27g== TAB1_NESTED
TREAT(SYS_NC_ROWINFO$ AS "GINTS"."H3")."SOME_TEXTS"
TAB1_NESTED TAB1
B
SQL> desc "SYSNTfsl/+pzu3+jgQAB/AQB27g=="
Name Null? Type
TXT VARCHAR2(100)OK let it be and now I'm trying to export and import in another schema:
[oracle@xxx]$ expdp gints/xxx@xxx directory=xxx dumpfile=gints.dmp logfile=gints.log
Export: Release 11.2.0.1.0 - Production on Thu Feb 4 22:32:48 2010
<irrelevant rows skipped>
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "GINTS"."TAB1" 0 KB 0 rows
. . exported "GINTS"."SYSNTfsl/+pz03+jgQAB/AQB27g==" 0 KB 0 rows
. . exported "GINTS"."TAB1_NESTED" 0 KB 0 rows
. . exported "GINTS"."SYSNTfsl/+pzu3+jgQAB/AQB27g==" 0 KB 0 rows
Master table "GINTS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************And now import. In order to create types transformation of OIDs is applied and also remap_schema
Although it fails to create the table.
[oracle@xxx]$ impdp gints1/xxx@xxx directory=xxx dumpfile=gints.dmp logfile=gints_imp.log remap_schema=gints:gints1 transform=OID:n
Import: Release 11.2.0.1.0 - Production on Thu Feb 4 22:41:48 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Release 11.2.0.1.0 - Production
Master table "GINTS1"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "GINTS1"."SYS_IMPORT_FULL_01": gints1/********@xxx directory=xxx dumpfile=gints.dmp logfile=gints_imp.log remap_schema=gints:gints1 transform=OID:n
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"GINTS1" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/TABLE/TABLE
ORA-39083: Object type TABLE:"GINTS1"."TAB1" failed to create with error:
ORA-02320: failure in creating storage table for nested table column B
ORA-00904: : invalid identifier
Failing sql is:
CREATE TABLE "GINTS1"."TAB1" ("A" NUMBER, "B" "GINTS1"."TBL_H1" ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
ORA-39083: Object type INDEX_STATISTICS failed to create with error:
ORA-01403: no data found
ORA-01403: no data found
Failing sql is:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('GINTS1','TAB1_NESTED',NULL,'TREAT(SYS_NC_ROWINFO$ AS "GINTS"."H2")."SOME_TEXTS"',1); DBMS_METADATA.GET_STAT_INDNAME('GINTS1','TAB1_NESTED',c,1,i_o,i_n); INSERT INTO "
ORA-39083: Object type INDEX_STATISTICS failed to create with error:
ORA-01403: no data found
ORA-01403: no data found
Failing sql is:
DECLARE I_N VARCHAR2(60); I_O VARCHAR2(60); c DBMS_METADATA.T_VAR_COLL; df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS'; BEGIN DELETE FROM "SYS"."IMPDP_STATS"; c(1) := DBMS_METADATA.GET_STAT_COLNAME('GINTS1','TAB1_NESTED',NULL,'TREAT(SYS_NC_ROWINFO$ AS "GINTS"."H3")."SOME_TEXTS"',1); DBMS_METADATA.GET_STAT_INDNAME('GINTS1','TAB1_NESTED',c,1,i_o,i_n); INSERT INTO "
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "GINTS1"."SYS_IMPORT_FULL_01" completed with 4 error(s) at 22:41:52So any idea how to make export/import of such tables?
TIA
GintsTom Kyte has said it repeatedly ... I will repeat it here for you.
The fact that Oracle allows you to build object tables is not an indication that you should.
Store your data relationally and build object_views on top of them.
http://www.morganslibrary.org/reference/object_views.html
If you model properly, and store properly, you don' have any issues. -
Error when creating table with nested table of object
Dear all,
I tried to create a table that contains nested table of an object but got an error:
create or replace type some_obj is object (
a number, b blob
4 /
Type created.
create or replace type some_type is table of some_obj;
2 /
Type created.
SQL>
create table test (obj_id number, temp some_type) nested table temp store as nes_tab;
Table created.
SQL> create table test (obj_id number, temp some_type) nested table temp store as nes_tab
ERROR at line 1:
ORA-00955: name is already used by an existing objectWhat is causing the error? How can I troubleshoot this?
best regards,
ValValerie Debonair wrote:
never mind, I put "/" at the end of the create statement that makes executing create table twice....Yep. If I'm writing a script, I tend to just stick with "/" for all my statements, including the SQL as well as the DDL, otherwise it can be confusing whether a ";" is needed or not or whether it will try and execute it twice like you found.
"/" works for all. -
ANSI Standard Join with Nested Table
Does anyone know how to (or whether you actually can) use ansi standard table joins with nested tables.
Non-ansi standard would look something like this
SELECT e.empno
FROM departments d, TABLE(d.employees) e
WHERE d.deptno = 10;
Where d.employees is a nested table.
But if I try ansi-standard I like such:
SELECT e.empno
FROM departments d
JOIN TABLE(d.employees) e
WHERE d.deptno = 10;
I get
ORA-00905: missing keyword
because I have nothing to join it on.
Your help is very much appreciatedBoth replies worked fine.
I think I will go with the NATURAL JOIN as it seems the cleanest option.
Thanks Guru 2748 -
Trying to UNION two views with nested tables
I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod, and my objective is to generate some XML. What I have been doing in the past, is to create a view, and then pass that view to the DBMS_XMLQuery routine. This gives me a CLOB that I pass along to the application. A typical object would be something like:
create or replace type XML_UGroup_Member_Type as object (
username varchar2(128),
group_key varchar2(128));
create or replace type XML_UGroup_Member_List
as table of XML_UGroup_Member_Type;
show errors
Create or replace type XML_UGroup_Type as object (
Group_Space varchar2(32),
group_key varchar2(128),
group_name varchar2(255),
members XML_UGroup_Member_List);
/This particular application will be doing stuff with group information. Pretty simply types - a group with a name and a few other keys, and a list of members. A sample view would be like:
create or replace view xml_department_ugroup_view of xml_ugroup_type
with object identifier ( group_key ) as
Select 'Department',
'Department:' || orgn_code,
'Department_' || orgn_name
cast ( multiset (
select Username, person_id,
'Department:' || effective_orgn
from directory_master dm, logins l
where effective_orgn = dd.orgn_code
and dm.person_id = l.owner)
as XML_UGroup_Member_List )
as members
from directory_departments dd
where dept_include = 'Y';
can select from this view, and I can pass it to the DBMS_XMLQUERY package and get a nice XML document. What I want to is essentially put several of these views together, like
Select * from XML_Department_Ugroup_View
Union
Select * from XML_Portfolio_Ugroup_View;But UNION does not work with nested tables:
ERROR at line 1: ORA-00932: inconsistent datatypes: expected - got SIMON.XML_UGROUP_MEMBER_LIST
What I was hoping to do, was to develop a set of sub views for each of the group "spaces", and then generate a view/object that includes all of the sub views, and be able to operate with that single object.
Thoughts on how to make this work, or on alternate approaches? I have considered calling XMLQuery on each of the sub views and concatenating the XML documents and returning that to the application, but I was hoping to find a more "unified" approach.I modified my approach a bit - I changed the base views to return an XMLType object, like:
create or replace view xml_portfolio_ugroup_xml
as
Select XMLElement("group",
xml_ugroup_type(
'Portfolio',
'Portfolio:' || coas_code || ':' || orgn_Code,
cast ( multiset (
select Username,
from directory_master dm, logins l
where ( effective_orgn, effective_coas ) in
where effective_orgn = dd.orgn_code
and dm.person_id = l.owner
as XML_UGroup_Member_List ))) as grp
from directory_departments dd
where dept_include = 'Y';and then I combined them with something like the following (I expect to adjust this as I learn more about the XML DB support)
create or replace view xml_ugroup_xml as
select xmlconcat(
(select xmlagg(grp) from xml_department_ugroup_xml),
(select xmlagg(grp) from xml_portfolio_ugroup_xml)
) as GROUPS
from dualand as I define more group branches, I can add them into the XMLConCat stanzas. I am still open to suggestions as to ways of doing this better or cleaner, but this at least gets the project moving forward again. -
Grant on table with Nested Column.
Hi,
I looked for an answer to this issue, but I couldn't find it. So, here it is. I am trying to grant select on a table with nested column to a different user and still the select won't work. Here is an example.
FIRST_USER@TST > create type test_object as object(ref01 varchar2(3));
2 /
Type created.
FIRST_USER@TST > create type test_type is table of test_object;
2 /
Type created.
"afiedt.buf" 3 lines, 100 characters
1 create table table1 (x varchar2(1), y test_type)
2* nested table y store as type1_nt return as value
FIRST_USER@TST > /
Table created.
FIRST_USER@TST > grant select on table1 to SECOND_USER;
Grant succeeded.
SECOND_USER @TST > select * from FIRST_USER.table1;
select * from FIRST_USER.table1
ERROR at line 1:
ORA-01031: insufficient privileges
I am sure I am missing something. I may have to give the grant a different way maybe? Please help.
Thank you.See http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjmng.htm#sthref786.
You need to grant execute to the appropriate user on the underlying type. -
Help in joining nested table with regular table
Im creating a nested table codelist as object prtcnpt_info. In a anonymous block im declaring t_code as nested table type codelist.
Now when i try to join the nested table with the regular oracle DB table and i get error: PL/SQL: ORA-00904: "COLUMN_VALUE": invalid identifier.
Please help me on this and provide tutorial link pertaining to this concepts..Below is the code i wrote
--Code Start;
create or replace type prtcnpt_info as object ( id number
,name varchar2(200)
,code varchar2(30));
create type codelist is table of prtcnpt_info;
declare
t_code codelist;
begin
select prtcnpt_info(b.pid ,b.name ,pt.code) bulk collect into t_code
from part pt
,mc_code b
where pt.cd in ('AAA','BBB')
and pt.ptype_id=b.pt_type_id;
INSERT INTO table ( ID
,RUN_ID
,DATA
,P_ID
SELECT id
,run_id
,data
,prtct.id ----> 1
FROM table_2 t2
,(select column_value from table(t_code)) prtct
WHERE prtct.id=t2.P_ID; ------> 2
end;
--Code End;
also from the anonymous block
1 => is this correct way to get value of id (b.pid) from the nested tablet_code aliased as prtct ?
2 => is this correct way to join the nested table with regular table? i want to join the column id's in both the tables.
Edited by: 914912 on Apr 30, 2012 2:11 AMWhen you create a table type without an object, i.e. a single column type like this you will get the column name as COLUMN_VALUE.
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Apr 30 07:38:32 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create or replace type mytbl as table of varchar2(10)
2 /
Type created.
SQL> var rc refcursor
"afiedt.buf" 11 lines, 162 characters
1 declare
2 ltbl mytbl;
3 begin
4 select to_char(level) bulk collect into ltbl
5 from dual
6 connect by level <= 10;
7 open :rc for
8 select * from table(ltbl);
9* end;
10 /
PL/SQL procedure successfully completed.
SQL> print rc
COLUMN_VAL
1
2
3
4
5
6
7
8
9
10
10 rows selected.And when you create a table type with object you will get the object column name.
SQL> drop type mytbl
2 /
Type dropped.
SQL> create type myobj as object (id varchar2(10))
2 /
Type created.
SQL> create type mytbl as table of myobj
2 /
Type created.
SQL> declare
2 ltbl mytbl;
3 begin
4 select myobj(to_char(level)) bulk collect into ltbl
5 from dual
6 connect by level <= 10;
7 open :rc for
8 select * from table(ltbl);
9 end;
10 /
PL/SQL procedure successfully completed.
SQL> print rc
ID
1
2
3
4
5
6
7
8
9
10
10 rows selected.
SQL> -
PL/SQL add procedure with nested table - Duplicate Thread
Hi,
I am trying to do a procedure to input information for one order and another for 2 orders.
The information I have so far is as follows:
Drop table Orders cascade constraints;
Drop type item_type;
Drop type Item_nested;
Create or Replace Type item_type AS Object (
Cat_code Varchar2(6),
Amount_ord Number(3),
Cost Number(5,2) );
Create or Replace Type item_nested as table of item_type;
Create Table Orders (
Order_no Varchar2(8) constraint pkorder primary key,
Customer_name Varchar2(30),
AddressLine1 Varchar2(20),
AddressLine2 Varchar2(20),
AddressLine3 Varchar2(20),
Town Varchar2(20),
Postcode Varchar2(10),
Country Varchar2(20),
Order_items item_nested,
Order_date Date)
Nested Table Order_items
Store as nested_items return as locator;
This has so far worked but I have not managed the insert procedure.
I am using Oracle SQL*plus
Thanks
SG
Edited by: user10689875 on 11-Jan-2009 03:39Duplicate thread ->
PL/SQL add procedure with nested table
Please remove it & marked it as duplicate.
Regards.
Satyaki De. -
Problem when expanding Tree - Tree with nested table column
Hi, i have created the tree using the Tree with nested table column.
I have created a node called TREE_ROOT in the context.
This node has few attributes which includes children_loaded, is_leaf, is_expanded.
I have created the recursive node TREE_SUB for the above node TREE_ROOT.
In the view, i have created the table with the master column. The above attributes have been mapped accordingly. I have created the action handler for load_children.
In this action handler method, i receive the context_element correctly. In this method, i determine the children of the selected element and the resulting children are attached to this context_element.
But the problem is: when i add elements to context_elements in the method load_children, these
elements get added to the node TREE_ROOT as well.
Please help.
thanks and best regards,
PramodI just use some types defined in this user... Well, I hope you know what is the type definition of d_period_sec,
don't you ? I didn't ask to provide all types existed now, only types you are
using.
Anyhow you have been granted with execute privilege for types you are using:
SQL> conn tau_tll/tau_tll;
Connected.
SQL> create or replace type d_period_sec as object (date# date);
2 /
Type created.
SQL> grant execute on d_period_sec to public with grant option;
Grant succeeded.
SQL> conn scott/tiger
Connected.
SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT (
2 xi NUMBER,
3 yi NUMBER,
4 xe NUMBER,
5 ye NUMBER,
6 xm NUMBER,
7 ym NUMBER,
8 v NUMBER,
9 a NUMBER,
10 f NUMBER,
11 descr VARCHAR2 (20)
12 );
13 /
Type created.
SQL> grant execute on unit_function to master;
Grant succeeded.
SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
2 (
3 p tau_tll.d_period_sec, -- from user TAU_TLL
4
5 m unit_function
6 )
7 /
Type created.
SQL> grant execute on unit_moving_point to master;
Grant succeeded.
SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
2 /
Type created.
SQL> grant execute on moving_point_tab to master;
Grant succeeded.
SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT (u_tab moving_point_tab);
2 /
Type created.
SQL> grant execute on moving_point to master;
Grant succeeded.
SQL> conn master/master
Connected.
SQL> CREATE TABLE MPOINTS (
2 id NUMBER,
3 mpoint scott.Moving_Point)
4 NESTED TABLE mpoint.u_tab store as moving_tab;
Table created.Rgds. -
Fill datagridview with Nested Table Object Type ???
Hello everybody, please you help me resolve my problem?
I follow this example: *(A Sample Application using Object-Relational features)* http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10799/adobjxmp.htm
And this tutorial: *(Using Oracle User-Defined Types with .NET and Visual Studio)* http://www.oracle.com/technology/obe/hol08/dotnet/udt/udt_otn.htm
Now I have 3 Object Table: Stock, Customer and Purchase Order. With the tutorial it's OK to show the data of Stock and Customer Table [there is no nested table in], but I can't do this with table Purchase Order, the tutorial don't show how to work with Nested Table type [Missing or something ?]
When I try to display the data of table Purchase Order, I get the error:
typeName='LINEITEMLIST_NTABTYP'' is not specified or is invalid*
Follow the tutorial, I generate custom class for this UDT and get another error:
this.STOCK_REF = ((object)(Oracle.DataAccess.Types.OracleUdt.GetValue(con, pUdt, "STOCK_REF")));*
Argument Exception Unhandle: Object attribute is not mapped to a custom type member.*
Can You show me how to do this ? Show the data of the Nested Table in Visual Studio, do I have something wrong ??? Thanks and Best Regards.I think you need to go through the tutorial more carefully. I think you are missing steps.
You are using a REF. Are you creating an object table for the objects to be stored in? Are you dereferencing the REF? This is covered by the Oracle by Example tutorial.
http://www.oracle.com/technology/obe/hol08/dotnet/udt/udt_otn.htm#t11
When you receive the nested table, it will be inside a .NET class. You can create this class by using the Create Custom Class menu item on the nested table type in server explorer.
This class will contain a ToString method and a ToXML method.
The question is, where are you attempting to display the data from this nested table? In a grid?
Does it make sense to display a nested table inside one cell of a grid? No. You would need to construct a special UI that will show the
nested table. Maybe the user clicks on the cell on the grid, which opens a new grid that displays the data. Or maybe there is a second grid on the form that always shows the nested table for the row that the first grid currently has selected.
I realize I am not providing you the code... but it sounds like you need to design a more sohisticated UI than what the tutorial is using -- one that can handle displaying one additional table per row. -
How to work with nested tables
HI Everybody,
I have a relational table one of whose columns is an object and another column is a collection stored as a nested table. I would like to set up a user interface ADF Rich Client, where I consider the parent table as Master and the nested table as Detail. If I build a READONLY master and detail view with a view link based on the primary key of the parent table, it works fine. However, when I try to generate entities from the views, the detail view object disappears from JDeveloper. Otherwise, when I try to make business components from tables, the nested table is not listed. Do anyone know a solution?
Please help!
Here is the view creation script with table structures:
create or replace view dp_master_view as
select p.dept_no,p.dept_name, p.dept_mgr.idno mgr_idno, p.dept_mgr.name mgr_name,p.dept_mgr.phone mgr_phone from department_persons p
create or replace view dp_detail_view as
select p.dept_no,e.* from department_persons p,table(p.dept_emps) (+) e
SQL> desc department_persons
Name Null? Type
DEPT_NO NOT NULL NUMBER
DEPT_NAME CHAR(20)
DEPT_MGR PERSON_TYP
DEPT_EMPS PEOPLE_TYP
SQL> desc person_typ
Name Null? Type
IDNO NUMBER
NAME VARCHAR2(30)
PHONE VARCHAR2(20)
Thanks, regards
Miklos HERBOLYHI Everybody,
I have a relational table one of whose columns is an object and another column is a collection stored as a nested table. I would like to set up a user interface ADF Rich Client, where I consider the parent table as Master and the nested table as Detail. If I build a READONLY master and detail view with a view link based on the primary key of the parent table, it works fine. However, when I try to generate entities from the views, the detail view object disappears from JDeveloper. Otherwise, when I try to make business components from tables, the nested table is not listed. Do anyone know a solution?
Please help!
Here is the view creation script with table structures:
create or replace view dp_master_view as
select p.dept_no,p.dept_name, p.dept_mgr.idno mgr_idno, p.dept_mgr.name mgr_name,p.dept_mgr.phone mgr_phone from department_persons p
create or replace view dp_detail_view as
select p.dept_no,e.* from department_persons p,table(p.dept_emps) (+) e
SQL> desc department_persons
Name Null? Type
DEPT_NO NOT NULL NUMBER
DEPT_NAME CHAR(20)
DEPT_MGR PERSON_TYP
DEPT_EMPS PEOPLE_TYP
SQL> desc person_typ
Name Null? Type
IDNO NUMBER
NAME VARCHAR2(30)
PHONE VARCHAR2(20)
Thanks, regards
Miklos HERBOLY -
I am trying to make a nested table receive an arbitrary number of values (from a shuttle) through a loop, and then insert the table into a table of nested table in my database. The problem I am having is that when I try to insert more than one value into the nested table, it will only insert the last item in the loop into the database. Thanks in advance.
This is the code I used to create my objects:
create or replace type OUTPUT_TY as object( ATTRIBUTE_ID Number(8) )
create or replace type OUTPUTS_NT as table of OUTPUT_TY
This is my actual code in ApEx:
declare
temp_NT OUTPUTS_NT;
temp_TY OUTPUT_TY;
temp Number(10);
l_vc_arr2 htmldb_application_global.vc_arr2;
begin
temp_nt := outputs_nt();
l_vc_arr2 := HTMLDB_UTIL.string_to_table (:P2_SHUTTLE, ':');
FOR i IN 1 .. l_vc_arr2.COUNT
LOOP
temp_ty := output_ty(l_vc_arr2(i)) ;
temp_NT:= outputs_nt(temp_ty);
END LOOP;
INSERT INTO OUTPUT_TEST values (temp_NT);
commit;
end;> temp_NT:= outputs_nt (temp_ty);You are not extending the nested table / collection, you are simply assigning an entirely new collection to it for each element of l_vc_arr2.
Try something like...
FOR i IN 1 .. l_vc_arr2.COUNT LOOP
temp_ty := output_ty (l_vc_arr2 (i));
temp_nt.EXTEND;
temp_nt (temp_nt.LAST) := temp_ty;
END LOOP;Or perhaps more succintly...
FOR i IN 1 .. l_vc_arr2.COUNT LOOP
temp_nt.EXTEND;
temp_nt (temp_nt.LAST) := output_ty (l_vc_arr2 (i));
END LOOP; -
Null value in Nested table of nested table for xml guru Steve Muench
The procedure I am using takes xml document with nested levels and insert into single table using DBMS_XMLSave.insertXML.
I am able to insert into table without any error message but when I am selecting row from table, it is showing null values in all the column of nested table's inner nested table.
When I am removing nested table's nested table by replacing with object type, it is showing data of object type for the first occurance and ignoring the rest nested occurance.
Help is greatly appreciated.
Below is the sql I used to create objects and table:-
Create or Replace Type addressType as Object
Line_one varchar2(40),
Line_two varchar2(40),
City Varchar2(30),
State Varchar2(2),
zip Varchar2(10)
Create or Replace Type ce_reqType as Object
Status varchar2(25),
Status_date Date,
type_code Varchar2(25),
review_begin_date Date,
assigned_review_date date
Create or Replace type ce_reqListType
as table of ce_reqType;
Create or Replace Type LicenseType as Object
type_code Varchar2(10),
license_number Varchar2(16),
ce_requirements ce_reqListType
Create or Replace type LicenseListType
as table of LicenseType;
Create table IndividualType
individual_id Number(9),
social_security_number Varchar2(9),
Last_name varchar2(40),
First_name Varchar2(40),
Middle_name Varchar2(40),
Birth_date Date,
address addressType,
Licenses LicenseListType
nested table licenses store as licensestab
(nested table ce_requirements store as lic_ce_reqtab);Maddy wrote:
dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)Because instead of adding an element to bookset collectionto are assigning (ergo replacing) it a collection containing last fetched book. Use:
declare
bookset book_table;
ln_cnt pls_integer;
begin
bookset := book_table(book_obj('madhu','kongara','sudhan'));
dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
bookset := book_table(); --> Assigning back to NULL.
dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
for rec in (select * from book) loop --> Now Looping two times.
dbms_output.put_line(' name > '||rec.name);
bookset.extend;
bookset(bookset.count) := book_obj(rec.name, rec.author, rec.abstract);
end loop;
dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
end;
The count is 1
The count is 0
name > Harry Potter
name > Ramayana
The count is 2
PL/SQL procedure successfully completed.
SQL> Or better use bulk collect:
declare
bookset book_table;
ln_cnt pls_integer;
begin
bookset := book_table(book_obj('madhu','kongara','sudhan'));
dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
bookset := book_table(); --> Assigning back to NULL.
dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
select book_obj(name,author,abstract)
bulk collect
into bookset
from book;
for i in 1..bookset.count loop --> Now Looping two times.
dbms_output.put_line(' name > '||bookset(i).name);
end loop;
dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
end;
The count is 1
The count is 0
name > Harry Potter
name > Ramayana
The count is 2
PL/SQL procedure successfully completed.
SQL> SY. -
Problem in truncate/drop partitions in a table having nested table columns.
Hi,
I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table? IF I change column types from nested table to varray type, will it help?
Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
Thanks in advance.>
I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table?
>
Unfortunately you can't do those operations when a table has a nested table column. No truncate, no drop, no exchange partition at the partition level.
A nested table column is stored as a separate table and acts like a 'child' table with foreign keys to the 'parent' table. It is these 'foreign keys' that prevent the truncation (just like normal foreign keys prevent truncating partions and must be disabled first) but there is no mechanism to 'disable' them.
Just one excellent example (there are many others) of why you should NOT use object columns at all.
>
IF I change column types from nested table to varray type, will it help?
>
Yes but I STRONGLY suggest you take this opportunity to change your data model to a standard relational one and put the 'child' (nested table) data into its own table with a foreign key to the parent. You can create a view on the two tables that can make data appear as if you have a nested table type if you want.
Assuming that you are going to ignore the above advice just create a new VARRAY type and a table with that type as a column. Remember VARRAYs are defined with a maximum size. So the number of nested table records needs to be within the capacity of the VARRAY type for the data to fit.
>
Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
>
Sure - just CAST the nested table to the VARRAY type. Here is code for a VARRAY type and a new table that shows how to do it.
-- new array type
CREATE OR REPLACE TYPE ARRAY_T AS VARRAY(10) OF VARCHAR2(64)
-- new table using new array type - NOTE there is no nested table storage clause - arrays stored inline
CREATE TABLE partitioned_table_array
( ID_ INT,
arra_col ARRAY_T )
PARTITION BY RANGE (ID_)
( PARTITION p1 VALUES LESS THAN (40)
, PARTITION p2 VALUES LESS THAN(80)
, PARTITION p3 VALUES LESS THAN(100)
-- insert the data from the original table converting the nested table data to the varray type
INSERT INTO PARTITIONED_TABLE_ARRAY
SELECT ID_, CAST(NESTED_COL AS ARRAY_T) FROM PARTITIONED_TABLENaturally since there is no more nested table storage you can truncate or drop partitions in the above table
alter table partitioned_table_array truncate partition p1
alter table partitioned_table_array drop partition p1
Maybe you are looking for
-
Filter on field in Interactive report to small/narrow
In a interactive report I have the problem that the first (about) 30 positions of the values of one of the fields is not unique. So if you want to use the filter function it is impossible to know which value is selected. Is there a way to make these
-
Logic Pro X and Yosemite issues
It seems I have some very basic issues with Logic Pro X 10.0.7 after upgrading to Yosemite OS on my MacBook Air: 1. Zooming the main window by swiping two fingers apart or together on the mouse pad does not work anymore. 2. Adjusting the length of au
-
Ios7 doesn't actually let me scale down a picture for the screen on the ipad.
When I try to set the background for the lock screen and home screen it says to move and scale like it always has, but this time it doesn't work. It will let me move it and scale but then it won't keep it that way. It reverts back to the original wa
-
I think I did wrong question I have installed Parallels on my Macbook Pro, and I'm interested in buying a Time Machine Airport, my concern is whether Time Machine also makes me the automatic backup of my files have Windows in Parallels
-
When I would like to upgrade my iPad2 at software update of general at settings, loading logo onscreen for hours with no progress. The goal is to upgrade iOS from 5 to 7.0.1. Any good solution for that?