Indexing table of XMLType
Hi
I have created an table in XML DB of type XMLType.
Can anyone tell me how I can index this table?
Oracle version is 9.2.0.3.0
Thanks
Omar
Thanks for the reply. This issue that I had was the table itself was of type XMLType.
I have now created the table with a column of XMLType to store the XML document in. This will then allow an index to be created on the XMLType column, thereby indexing the comple XML document.
Similar Messages
-
Index type created as "TABLE OF XMLTYPE?"
I have a crazy question.
Is it possible to create a structured or unstructured index on a type in Oracle 11.2.0.3 created as:
CREATE TYPE mytype AS TABLE OF XMLTYPE?You're right, crazy question
An index, whatever its type, is designed to work on a relational or object instance column, not on a class definition.
I don't know what you had in mind, but to give some sense out of your question you could imagine doing something like this :
- create the type definition
- create a table to hold instance of this type
- create the index on the nested table column
CREATE TYPE mytype AS TABLE OF XMLTYPE;
CREATE TABLE mytable (myobj mytype)
NESTED TABLE myobj STORE AS mytable$nt
XMLTYPE COLUMN column_value STORE AS SECUREFILE BINARY XML
CREATE INDEX mytable_uxi ON mytable$nt(column_value)
INDEXTYPE IS xdb.xmlindex ; -
How to create index on a xmltype column stored as CLOB
actually i have two problems.
i uploaded this schemaA.xsd file into xmldb repository without problems. registration also went ok.
BEGIN
DBMS_XMLSCHEMA.registerSchema(
schemaURL => 'http://xmlns.example.com/xdb/documentation/schemaA.xsd'
,schemaDoc => sys.UriFactory.getUri('/home/dev/schemaA.xsd')
,local => TRUE
,genBean => false
,genTypes => TRUE
,genTables => false
,enableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
END;
then i run this:
create table pf_table_a(
id VARCHAR2(100) primary key,
xsd VARCHAR2(3000),
xml_document XMLType
) XMLTYPE COLUMN xml_document
STORE AS CLOB
XMLSCHEMA "http://xmlns.example.com/xdb/documentation/schemaA.xsd"
ELEMENT "order";
and got this error:
SQL> @d:\usr\dev\perftest\create_tables.sql
Table created.
create table pf_table_a(
ERROR at line 1:
ORA-00955: name is already used by an existing object
anyway the table was created. so i went on to create indexes.
SQL> create index pf_a_index on pf_table_a(extractValue(OBJECT_VALUE, '/order@or
derNo'));
create index pf_a_index on pf_table_a(extractValue(OBJECT_VALUE, '/order@orderNo
ERROR at line 1:
ORA-04063: table "BAUSER1.PF_TABLE_A" has errors
this of course is wrong. because the command is for creating index of a XMLTYPE table. no a column. but what is the correct command? thanks.
jack.actually i have two problems.
i uploaded this schemaA.xsd file into xmldb repository without problems. registration also went ok.
BEGIN
DBMS_XMLSCHEMA.registerSchema(
schemaURL => 'http://xmlns.example.com/xdb/documentation/schemaA.xsd'
,schemaDoc => sys.UriFactory.getUri('/home/dev/schemaA.xsd')
,local => TRUE
,genBean => false
,genTypes => TRUE
,genTables => false
,enableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
END;
then i run this:
create table pf_table_a(
id VARCHAR2(100) primary key,
xsd VARCHAR2(3000),
xml_document XMLType
) XMLTYPE COLUMN xml_document
STORE AS CLOB
XMLSCHEMA "http://xmlns.example.com/xdb/documentation/schemaA.xsd"
ELEMENT "order";
and got this error:
SQL> @d:\usr\dev\perftest\create_tables.sql
Table created.
create table pf_table_a(
ERROR at line 1:
ORA-00955: name is already used by an existing object
anyway the table was created. so i went on to create indexes.
SQL> create index pf_a_index on pf_table_a(extractValue(OBJECT_VALUE, '/order@or
derNo'));
create index pf_a_index on pf_table_a(extractValue(OBJECT_VALUE, '/order@orderNo
ERROR at line 1:
ORA-04063: table "BAUSER1.PF_TABLE_A" has errors
this of course is wrong. because the command is for creating index of a XMLTYPE table. no a column. but what is the correct command? thanks.
jack. -
Export/import table with XMLTYPE data_type and fine_grained policy
Hi friends!
I'm trying to export a table with XMLTYPE and faine-grained policy.
Source: HP-UX - Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
Target: Linux 2.6.18-238.el5 - Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
I do it thru exp/imp old utilities as mention in metalink ID 1318012.1.
One of the things that surprised me after exp/imp is that the number of objects increased:
Objects at Source:
exp \"/ as sysdba\" owner=xml log=xml file=xml.dmp
Type
Number of Objects
TYPE
431
TRIGGER
6
TABLE
17
PROCEDURE
2
LOB
120
INDEX
17
FUNCTION
1
On Target:
imp \"/ as sysdba\" file=xml.dmp fromuser=xml touser=xml log=xml.log
Type
Number of Objects
TYPE
431
TABLE
32
PROCEDURE
2
LOB
429
INDEX
478
FUNCTION
1
Why is this happening? Is it normal?
Other problem that I found is triggers are not imported, why!?!?
Thank you very much for your help!
JoséHi!
The new squema was created empty. If I run the following query:
select '10g', TABLE_NAME,COUNT(*)
from DBA_LOBS@DSN_HP
where OWNER='XML'
group by TABLE_NAME
union
select '11g', table_name,count(*)
from DBA_LOBS
where OWNER='XML'
group by TABLE_NAME
order by 2,1
As a result:
Version
Table_name
Total
10g
ACTION_TABLE
1
11g
ACTION_TABLE
1
10g
Document1767_TAB
14
11g
Document1767_TAB
13
10g
Document1852_TAB
14
11g
Document1852_TAB
13
10g
Document1941_TAB
16
11g
Document1941_TAB
15
10g
Document2016_TAB
14
11g
Document2016_TAB
13
10g
Document2087_TAB
13
11g
Document2087_TAB
12
10g
IBT_XML_RECIBIDOS
1
11g
IBT_XML_RECIBIDOS
1
10g
LINEITEM_TABLE
2
11g
LINEITEM_TABLE
2
10g
PURCHASEORDER
7
11g
PURCHASEORDER
7
10g
PurchaseOrder1145_TAB
9
11g
PurchaseOrder1145_TAB
7
10g
RICARDO
13
10g
RICARDO2
1
11g
RICARDO2
1
10g
RITNTFER
1
11g
RITNTFER
1
10g
RITNTFRE_08
13
11g
SYS_NT3+LEU6vbfGLgQ18DLgrURw==
69
11g
SYS_NT3+LEU6vffGLgQ18DLgrURw==
76
11g
SYS_NT3+LEU6vjfGLgQ18DLgrURw==
63
11g
SYS_NT3+LEU6vpfGLgQ18DLgrURw==
1
11g
SYS_NT3+LEU6vqfGLgQ18DLgrURw==
2
11g
SYS_NT3+LEU6vTfGLgQ18DLgrURw==
65
11g
SYS_NT3+LEU6vXfGLgQ18DLgrURw==
66
10g
TESTCLOB
1
11g
TESTCLOB
1
There are many new tables created...I suppose because the differences between versions...
Any ideas?
Thanks a lot!
José -
Retriving the XMLData from a table of XMLtype
Hi,
I am Creating a table of xmltype and inserting xml into the table.
1. create table test_tab of xmltype xmlschema "/public/config.xsd" element "Config" ;
2. insert into test_tab values('<Config
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/public/config.xsd">
<ApsConfig>
<TcpInterfaceConfig>
<Mode>CONNECT</Mode>
<Port>28496</Port>
</TcpInterfaceConfig>
</ApsConfig>
</Config>');
How to retrieve the above inserted row into a new XML file?
If i used the dbms_xmlgen() to get the xml, its not showing properly.
Please help me.
Thanks ahead.....
Edited by: jagdish1206 on 24 Mar, 2010 3:41 AMFrom Oracle's documentation
The DBMS_XMLGEN package converts the results of a SQL query to a canonical XML formatSince your data is already XML, there is no need to use DBMS_XMLGEN (unless you are doing something more complex not mentioned in your post). Just use a simple
select * from test_tab;
to see your data.
Example:
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
SQL> create table test_tab of xmltype; -- shortened as don't have your schema
Table created
SQL>
SQL> insert into test_tab values('<Config
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:noNamespaceSchemaLocation="/public/config.xsd">
4 <ApsConfig>
5 <TcpInterfaceConfig>
6 <Mode>CONNECT</Mode>
7 <Port>28496</Port>
8 </TcpInterfaceConfig>
9 </ApsConfig>
10 </Config>');
1 row inserted
SQL> select * from test_tab;
SYS_NC_ROWINFO$
<Config
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceS
SQL> set long 1000 -- Doing for display purposes only
SQL> select * from test_tab;
SYS_NC_ROWINFO$
<Config
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/public/config.xsd">
<ApsConfig>
<TcpInterfaceConfig>
<Mode>CONNECT</Mode>
<Port>28496</Port>
</TcpInterfaceConfig>
</ApsConfig>
</Config> -
BPL Sales orders: Updating index tables
Hello forum,
After using BPL to copy sales orders, index tables are not updated. Examples of these tables are VAKPA (sales index by partner function), VAPMA (sales index by material), VLPMA (deliveries by material) or VRPMA (billing documents by material).
To correct this what we do is run program RVV05IVB (Reorganization of SD Document Indices) but this report is very time consuming. (it is not that easy to know the documents numbers for all sales / deliveries / billing docs that were copied so we have to run the report for all documents; even if we knew the document numbers, though, the report is very slow because these tables do not have an index by document).
Is this the way to do it, or are other people working differently?
Or should these tables be included in the context?
Thanks in advance,
Rui Dantas>
Nico Gaertner wrote:
> Alternatively you can also create this index on the receiver side and connect these tables with the Table VBUK in the BPL datamodel.
> Nico
In this case you mean sender system, right?
The access won't be that bad if you choose the right table to link: VBAP-MATNR for VAPMA, or VBPA-KUNNR + VBPA-PARVW for VAKPA. I'll try in our system.
It would be even better, of course, if we could link from more than one table (e.g. VBAK + VBAP to VAPMA). This is not possible, right? -
Hi everybody,
I have two Distinct Databases on two distinct servers. (Oracle Ent. Release 10.2.0.3.0 on AIX 5.3). After I install the latest patch last week, One of the APEX installation has some problems on Home>Application Builder Page. The error message is very random and
report error:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
When i change the view (details to icons), everything goes to normal. This error message is reflected some of the pages (report region) of some of my applications randomly. When it appears in a report region, i deselect the order method of the region, the result is normal.
But the other APEX application on the other instance has no problem. It is a bug? or Should i re-install the APEX instance?
Thank you for your interest?
Gökhan ÇATALKAYANo, but we have a reproducible test case now so we're working on it. See ORA-06502: PL/SQL: numeric or value error: NULL index table key value
Scott -
Hi,
I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
My Approach is :
a) Create a record type variable ( concists of multiple segments)
b) Create a pl/sql table type of the records type in a)
c) Created a cursor of same structure as pl/sql table type ( collects data)
d) BULK CoLLECT data from cursor into pl/sql table
e) Print the data
But during Bulk Collect i get the below error :
Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated BindAshish_Apps wrote:
Hi,
I am trying toceate an interface which collects data from database make some transformation and populated seeded tables in the same database.
My Approach is :
a) Create a record type variable ( concists of multiple segments)
b) Create a pl/sql table type of the records type in a)
c) Created a cursor of same structure as pl/sql table type ( collects data)
d) BULK CoLLECT data from cursor into pl/sql table
e) Print the data
But during Bulk Collect i get the below error :
Unexpected error in xxc_hr2hr_populate_elements.main at FLOW TRACE-1.120. Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value
ORA-20003: Unexpected error in xxc_hr2hr_populate_elements.get_data at FLOW TRACE-1.1.100. Error: ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated BindVerify the rows you are fetching are having the same data types as your Record like Dates should go to date , decimal should not be fetched in type defined as number etc. -
Confused by the removal of aggregate/index tables in HANA
Hiya,
I've heard that HANA removes the need for aggregate and index tables like BSIS, BSAS, VRPMA etc.
Is HANA smart enough to do this? Or does Simple finance (sFIN) do this?
I mean if we were to replace our Oracle DB with HANA would the index tables no longer exist?
Or would we then need to implement simple finance to then remove the need for index tables?
Thanks in advance!"HANA is just the DB."
I wouldn't say it's "just" a DB, but for the point we're making here you can say that SAP HANA is mainly used as a DBMS and not as a application platform.
"To remove index tables, aggregate tables etc you can activate business functions through SFW5 to improve specific lines of business."
That's not generally true. Some enhancements (like the VBOX removal) are delivered via enhancement packages. These change the software, but typically don't make a new product out of your system.
"Installation of sFIN, or S/4HANA contain more deeper changes to both the tables and ABAP code - that improve speed and efficiency."
Nope, these are actual new implementations. These are new programs that do similar things as the former NetWeaver programs. But they are newly written code.
This allows for much more radical redesign of functionality leading (hopefully) to even more improvements.
Coming back to your first sentence: the more radical the software changes the more tightly integrated the solution will be with SAP HANA. More and more function will actually run "in" SAP HANA, making it more than just the DB.
Ok, I hope this didn't increase the confusion again.
Cheers,
Lars -
Hi,
Can anyone let me know what is the issue on below code and how can we avoid that? i am getting the error like below
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
v_while_loop := 1;
v_delete_char_id := v_tabtype_result_values.FIRST;
WHILE v_while_loop <> v_tabtype_result_values.COUNT
LOOP
IF check_duplicate_nc_data (v_result_view,
v_tabtype_result_values(v_delete_char_id).value,
v_collection_id,
v_occurrence,
v_plan_id,
v_delete_char_id
THEN
DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
v_tabtype_result_values.DELETE(v_delete_char_id);
ELSE
DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
||v_tabtype_result_values(v_delete_char_id).value||','
||v_tabtype_result_values(v_delete_char_id).validation_flag
END IF;
v_while_loop := v_while_loop + 1;
v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
END LOOP;Change:
WHILE v_while_loop <> v_tabtype_result_values.COUNT to
WHILE v_while_loop <= v_tabtype_result_values.LASTSY. -
ORA-06502: PL/SQL: numeric or value error: NULL index table key value Repor
W've been experiencing the Oracle Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value Report’ [we are currently on apex v3.0.1]. From the forum there was a reference to a bug fix: apex bug (6416829) fixed in 3.1. When we view '6416829' in Metalink we can see the bug title but cannot see any details as it's protected. Can anyone shed some light on why it's protected or provide further details.
We have many LIVE customers reporting this error and we want to be certain it's fixed in v3.1.
(currently we are working around this by flushing the shared pool but this is not ideal).
Any help would be appreciated.Scott,
This error has been thrown several times in the past 24 hours. Yesterday several of my reports threw the error, these reports have done so in the past. This morning APEX has begun throwing the error of which I have seen only once before. This is occuring at Home>Application>My Application. The error appears when I attempt to View the report in Details mode, is OK when I view the report in Icons mode. The error is occuring in my Prodution environment which has not been updated since 2/25/2009.
As before, I edited the SQL on my application's reports and the error then disappeared.
We are running Application Express 3.2.0.00.27 and Oracle Release 10.2.0.1.0. My browser is IE 7.0.
Plan to test later with FireFox provided I can download it to see if this might browser related.
Any inforamtion or guidance is appreciated.
Jeff -
ORA-06502: PL/SQL: numeric or value error: NULL index table key value in Package OE_Order_PVT Procedure Lines
Where is the problem?
thanks
Edited by: huak on Feb 5, 2009 5:08 PMthank you
My EBS is On 11.5.9 in Production, but Note: 433074.1 is based on 11.5.10.2 in Production.
AND I use the api with test windows to declare code in PL/SQL developer that is right. But I use api in the a package for a ebs' request that is error.
:( -
How to register PL/SQL index table parameter in OracleCallableStatement ?
Hello ,
I am using Oracle release 8.1.6.0.0 . I need to call a PL/SQL procedure through JDBC, which specifies an INDEX TABLE OUT parameter(e.g. TYPE type_name IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER) .
I found that with Oracle8i release 8.1.7, the Oracle JDBC OCI driver supports PL/SQL index-by tables using the registerIndexTableOutParameter method . But I have Oracle 8.1.6 and our client has 8.1.2!
Is there any way that I can read INDEX TABLE PARAMETER from PL/SQL procedure with Oracle release 8.1.2 and 8.1.6?
Another question is - Is it possible to do this with Oracle thin driver also ?
Regards,
Mukuli got the same problem? did you find the way to do it yet?
thks a lot
regards. -
Performance issue when inserting into spatial indexed table with JDBC
We have a table named 'feature' which has a "sdo_geometry" column, and we created spatial index on that column,
CREATE TABLE feature ( id number, desc varchar, oshape sdo_gemotry)
CREATE INDEX feature_sp_idx ON feature(oshape) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
Then we executed the following SQL to insert about 800 records into that table(We tried this by using DB visualizer and
our Java application, both of them were using JDBC driver to connect to the oracle 11gR2 database) .
insert into feature(id,desc,oshape) values (1001,xxx,xxxxx);
insert into feature (id,desc,oshape) values (1002,xxx,xxxxx);
insert into feature (id,desc,oshape) values (1800,xxx,xxxxx);
We encoutered the same problem as this topic
Performance of insert with spatial index
It takes nearly 1 secs for inserting one record,compare to 50 records inserted per sec without spatial index,
which is 50x drop in peformance when doing insertion with spatial index.
However, when we copy and paste those insertion scripts into Oracle Client(same test and same table with spatial index), we got a totally different performance result:
more than 50 records inserted in 1 secs, just as fast as the insertion without building spatial index.
Is it because Oracle Client is not using JDBC? Perhaps JDBC was got something wrong when updating those spatial indexed tables.
Edited by: 860605 on 19/09/2011 18:57
Edited by: 860605 on 19/09/2011 18:58
Edited by: 860605 on 19/09/2011 19:00Normally JDBC use auto-commit. So each insert can causes a commit.
I don't know about Oracle Client. In sqlplus, insert is just a insert,
and you execute "commit" to explicitly commit your changes.
So maybe this is the reason. -
Exporting Parameter of type 'INDEX TABLE'
Hi Experts,
there is a standard method CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS in CRM which has an exporting parameter ET_TRADESPENDS of type INDEX TABLE. Could somebody give me a hint on how to call this method and work with the data that is returned? I am assuming that I will need field symbols for this, correct? Coding examples would be greatly appreciated.
Thanks,
JensHi Jens,
INDEX TABLE is a generic type. The data object expected depends on configuration and/or context. As we don't have any CRM system I can check CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS I can't give you the details.
I have some experience with comparable methods in SAP Transportation Managament which uses the BOPF framework. In program context, we know what type of table structure will be expected, so we defined a local table accordingly and passed it to the ET parameter.
If you don't have any idea on how to find out, just declare any internal table, i.e-lt_test type table of string. Then call the method with parameter ET_TRADESPENDS = lt_test. This will dump for sure. Enter debugger and check what kind of data are returned. From the field names you may get a clue what structure it could be. Dump analysis may also provide some info.
Regards,
Clemens
Maybe you are looking for
-
Disk utility won't erase a dvd-rw
i want to erase my dvd-rw and when i go to disk utility and click "completely erase" the status bar says "preparing the drive" and then "waiting for drive" and right after that a window pops up saying that i've just inserted a blank dvd, and it asks
-
Colored bars in clip after apply a little motion
I get these colored bars in my clip after applying some motion effects (kern). Rendering does not solve. Any idea? Here is a screenshot: http://kttns.org/nkzgy
-
Missing permission when calling sap transaction via composer
Hello, we have created a complex model. in this model some sap transaction are called. With Administrator rules everything is working fine. but when portal role is assigned to a normal user, only real composer parts are working and all url ivew calli
-
I keep getting a waiting sign on downloading apps
I keep getting a waiting sign every time I try to download an app
-
TS1702 Recently Navigation is not working in my ipad2
In past my navigation is working properly with google maps but recently I upgrade my ipad2 iOS , find tHat my google maps was changed and navigation is working now