Xdb:SQLCollType need to be unique?
<xs:element name="Contractee" xdb:SQLType="XDBPO_CONTRACTEE_TYPE" xdb:defaultTable="">
<xs:complexType>
<xs:sequence>
<xs:element name="Address" type="AddressType" minOccurs="0"/>
<xs:element name="Contact" type="ContactType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="Contact" xdb:SQLCollType="XDBPO_Contact_CLLT"/> </xs:sequence>
<xs:attribute name="Id" type="xs:string" use="required" xdb:SQLName="Id" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="PartyName" type="xs:string" use="required" xdb:SQLName="PartyName" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="ParentId" type="xs:string" xdb:SQLName="ParentId" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="Role" use="required" xdb:SQLName="Role" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="Contractee"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Contractor" xdb:SQLType="XDBPO_CONTRACTOR_TYPE" xdb:defaultTable="">
<xs:complexType>
<xs:sequence>
<xs:element name="Address" type="AddressType" minOccurs="0"/>
<xs:element name="Contact" type="ContactType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="Contact" xdb:SQLCollType="XDBPO_Contact_CLLT"/> </xs:sequence>
<xs:attribute name="Id" type="xs:string" use="required" xdb:SQLName="Id" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="PartyName" type="xs:string" use="required" xdb:SQLName="PartyName" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="ParentId" type="xs:string" xdb:SQLName="ParentId" xdb:SQLType="VARCHAR2"/>
<xs:attribute name="Role" use="required" xdb:SQLName="Role" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="Contractor"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
does both of the collections need to be unique?
Is there a limitations in declaring to collections in a single xmltype?
<xs:complexType name="MessageHeaderType" xdb:SQLType="XDBPO_MESSAGEHEADER_TYPE">
<xs:sequence>
<xs:element name="Configuration" type="ConfigurationType" minOccurs="0"/>
<xs:element name="HeaderIndexedAttribute" type="HeaderIndexedAttributeType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="HeaderIndexedAttribute" xdb:SQLCollType="XDBPO_HIATTRIBUTE_CLLT"/>
<xs:element name="test" type="IndexedAttributeType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="test" xdb:SQLCollType="XDBPO_test_CLLT"/>
</xs:sequence>
SQL> desc XDBPO_MESSAGEHEADER_TYPE
XDBPO_MESSAGEHEADER_TYPE is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
version VARCHAR2(4000)
payloadId VARCHAR2(4000)
transmissionAgent VARCHAR2(4000)
timeStamp VARCHAR2(4000)
senderName VARCHAR2(4000)
senderComponent VARCHAR2(4000)
documentReferenceId VARCHAR2(4000)
documentReferenceIdType VARCHAR2(4000)
dataCleansingDocumentId VARCHAR2(4000)
singleTransaction VARCHAR2(4000)
Configuration XDBPO_CONFIGURATION_TYPE
HeaderIndexedAttribute XDBPO_HIATTRIBUTE_CLLT
test XDBPO_test_CLLT
SQL> desc XDBPO_test_CLLT
ERROR:
ORA-04043: object XDBPO_test_CLLT does not exist
SQL> desc XDBPO_HIATTRIBUTE_CLLT
XDBPO_HIATTRIBUTE_CLLT VARRAY(2147483647) OF XDBPO_HEADERINDEXEDATR_TYPE
XDBPO_HEADERINDEXEDATR_TYPE is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
index VARCHAR2(4000)
content VARCHAR2(4000)
SQL> desc XDBPO_HIATTRIBUTE_CLLT
XDBPO_HIATTRIBUTE_CLLT VARRAY(2147483647) OF XDBPO_HEADERINDEXEDATR_TYPE
XDBPO_HEADERINDEXEDATR_TYPE is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
index VARCHAR2(4000)
content VARCHAR2(4000)
Anyone have any ideas? any comments is welcome.
Thanks.
Similar Messages
-
Need to generate Unique User IDs in OIM
Hi,
I am working in OIM 9.1 environment right now. I need to generate unique User IDs for all the users who come via self request. My problem is that while creating the user ids, I can search for the existing users in OIM and AD easily, but i am unable to search the users for whom the request has been made but approval is pending. Such user ids are reserved in OIM so if an employee with the same first and last name comes, there might be a conflict which might lead to an error. Can someone suggest any api or query using which I can search for these IDs under request in OIM.If i use the userid generator as Pre-Insert, there will be a conflict if two similar named users request at the same time (or if one of the request is yet to be approved).
I am getting the below error while creating user id as Pre-Insert. What is the correct way of getting this done? Please suggest.
012-11-20 19:25:41,787 INFO [STDOUT] Running CREATEUSERINOIM
2012-11-20 19:25:41,788 INFO [STDOUT] Target Class = com.pldt.adapter.createuser.CreateUserInOIM
2012-11-20 19:25:41,788 INFO [STDOUT] ***********************Inside Create User****************************
2012-11-20 19:25:41,805 INFO [STDOUT] =====================Before Date Insert===============
2012-11-20 19:25:41,805 INFO [STDOUT] =====================hiredate===============1970-01-01
2012-11-20 19:25:41,805 INFO [STDOUT] ***************************section***************XTNL Active
2012-11-20 19:25:42,647 INFO [STDOUT] Running DISABLEUSERINOIM
2012-11-20 19:25:42,649 INFO [STDOUT] Target Class = com.pldt.adapter.disableuser.DisableUserInOIM
2012-11-20 19:25:42,649 INFO [STDOUT] Entered Method retrieveUtility in SelectApprovalUser class
2012-11-20 19:25:42,662 INFO [STDOUT] *************************************Inside disableOIMUser**********************
2012-11-20 19:25:42,662 INFO [STDOUT] *************************************2**************
2012-11-20 19:25:42,663 INFO [STDOUT] ******************tcUserIntf**********Thor.API.Operations.tcUserOperationsClient@5fd3131f
2012-11-20 19:25:42,663 INFO [STDOUT] *************usrkey**********713
2012-11-20 19:25:42,664 INFO [STDOUT] *************usrkey**********XTNL Active
2012-11-20 19:25:42,664 INFO [STDOUT] ********************employeeGroup check Value*************XTNL Active
2012-11-20 19:25:42,664 INFO [STDOUT] returning False
2012-11-20 19:25:42,797 INFO [STDOUT] ***********************User Created Succesfully****************************
2012-11-20 19:25:42,848 INFO [STDOUT] **************************Employee Group**********XTNL Active
2012-11-20 19:25:44,199 INFO [STDOUT] Running CREATEUSERINOIM
2012-11-20 19:25:44,200 INFO [STDOUT] Target Class = com.pldt.adapter.createuser.CreateUserInOIM
2012-11-20 19:25:44,200 INFO [STDOUT] ***********************Inside Create User****************************
2012-11-20 19:25:44,212 INFO [STDOUT] =====================Before Date Insert===============
2012-11-20 19:25:44,213 INFO [STDOUT] =====================hiredate===============1970-01-01
2012-11-20 19:25:44,213 INFO [STDOUT] ***************************section***************XTNL Active
2012-11-20 19:25:44,255 ERROR [XELLERATE.SERVER] Class/Method: tcUSR/verifyUserLogin Error :User Loginid is duplicate.
2012-11-20 19:25:44,258 ERROR [XELLERATE.SERVER] Class/Method: tcUSR/eventPreInsert Error :User login is not correct. -
Need to populate unique key based on the combintion of rows
Hi
I have one table like this below.
ID PUB_DATE PUB_NAME PP SECTION PAGE_No
20080225 TR 1AB L 004
20080225 TR 1AB L 004
20080225 HN 1AB L 002
20080225 HN 1AB L 002
20080225 WW 1p1 L 001
20080225 WW 1p1 L 001
I need to populate unique id for ID column based on the combination of rows.
Exampl:
We know that first two records are same, then i will populate ID as 1 for these two records. Then next two records are same , then i will populate ID as 2 for these two records.
I need to populate ID as follows.
ID PUB_DATE PUB_NAME PP SECTION PAGE_No
1 20080225 TR 1AB L 004
1 20080225 TR 1AB L 004
2 20080225 HN 1AB L 002
2 20080225 HN 1AB L 002
3 20080225 WW 1p1 L 001
3 20080225 WW 1p1 L 001
Please anybody help me?.
ThanksGet a programming logic book, look at master file versus transaction file (typically uses a bank as the business example). Try this yourself yet? Any PL/SQL experience? Or is this your homework assignment?
And look up what the definition of unique means in Oracle. Title of your thread is very misleading. -
Mapping Problem.. I Need to pass Unique value everytime to Target filed.
Hi All,
I need to pass some unique value everytime the message processed to the target field.
Source filed ---> Target Field
can anyone has the UDF to generate like this.. ?
I heard that through RFCLookup we can do that.. by maintaing some table and taking 2 parameters one as input and one as output and everytime when the message processes it will add by one to the previous value and pass to the target field.
I dont know much about these lookups..
Can anyone through some light on this, how i can solve this issue.??
Waiting for your answers.
Thanks&Regards
Deepthi.Hi Liang,
That's my exact issue.Please let me know when you find the solution.
Actually i tried with some UDF.. its generating unique values whenever mapping is executed.But when we Reboot the system we found that its reinitializing again from "1".
So definetly we need to maintain the count in some database and system has to update evytime according to that.
Iam trying something by calling RFC from UDF and updating the Ztable by incrementing everytime.
I wil let you know if i find any solution..
Meanwhile anyone wants to suggest me... Please respond.
Thanks
Deepthi. -
Help needed to get unique record from an internal table
Hi Everybody,
I have to get unique record from an internal table. i know we can use read statement with key condition .
But the problem is i have to use some relational operators like GE or LE.
eg
read table itab into wa with key width GE itab-widthfrom
width LE itab-widthto
machno eq itab-machno.
Its giving me error when I use the operators GE , LE.( I think since it can't find a unique record with those relational
operators in the with key statement)
Is there any other way to get unique record from internal table without using the loop?
Thanks,
SunnyUsing the read statement you will need some kind of loop. For example.
DO.
READ TABLE......
WITH KEY ......
READ = SPACE
IF SY-SUBRC EQ 0
TABLE-READ = 'X'.
MODIFY TABLE
ADD 1 TO W_FOUND.
ELSE
EXIT.
ENDIF
ENDDO.
IF W_FOUND EQ 1.
...record is unique.
ENDIF. -
Need to Create Unique key basis on Internal Refrence code in Oracle Product Hub
Hi Friends
We are in to new development of product catalog in Oracle Product Hub , As per the client requirmnent we have to
create a primary key attribute basis on the Internal refrence code for product and promotion
can any one please take interest and help for us to resolve this iussue.
Praveen Singh RathoreHi,
Thanks,
There are 3 columns involved with that table . Out of whihc one is a Primary Key (string) , The other column (Number) has a unique key constraint defined on it and the last column stores a value corresponding to the 2nd column.
The reason for me to do a create in the Finder exception is as follows.
I Loop through the Data present in JTable. As given in the example let us assume that there are 2 rows in the JTable. Out of whihc the First row needs an updation and the second row , which is a new row needs to be created. So During the First iteration of the loop, The findermethod does not throw any exception (Because it is a modfied row) and hence the update gets fired successfully. During the second iteration , since it is a new row the findermethod will throw a finder exception and hence create will get fired.
I understand that this is not a good coding style but then it is not 100% wrong and i need to find out as to why it is not working.
Hope am clear in explaining my problem
Thanks
Shanki -
BEx query needs to count unique characteristic values
Is there any way to build a query using BEx query designer to count the number of unique values of a characteristic. For instance, my cube has detailed transactions for claim information. Each claim number can have multiple products. My query need to show the number of claims that exist for each product. I don't want the detail of the claim number, just how many claims exist.
Product Gross Paid Loss Claim Count
Total Auto $ 43,865.01 ?
Total Property $ 4,068,321.57 ?
Not assigned 19,426Hi,
Creat calculated keyfigure with data functions Count value and save with technical name.
Right click on that go to propertes, select count with exception aggregation - Claim Number,
also use after aggregation and decimal places '0'.
Regards
Malyadri -
Need to overcome unique server name restriction (6.1)
Hello,
We need to have managed servers with same name to run on a given machine.
e.g. we have a server name - myserver.
We would like to run servers all having name myserver on our test machine. But
weblogic documentation tells taht all servers in a weblogic installation must
have unique names even across domains.
How can we overcome this restriction?
Can having different weblogic_home solve this problem.
Or any other way?
Why this restriction?
Regards
MohitHi,
As the article mentioned: When you choose the Switch Independent mode, you also can choose the:
Address Hash and Hyper-V Port and Dynamic algorithm.
When you choose the Hyper-V Port and Dynamic algorithm, you must use the Sum of Queues then you need set the non-overlapping processor set, you must to configure
each NIC in your team to use the different processors. As an example, if you have 16 CPUs and 2 NICs in your team, one correct configuration would be to assign CPUs 2-7 to the first NIC and CPUs 8-15 to the second NIC.
More information:
Windows Server 2012 NIC Teaming (LBFO) Deployment and Management
http://www.microsoft.com/en-us/download/confirmation.aspx?id=30160
Hope this helps.
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Need to generate unique sequence number based on category
Hi,
I have to update the NEW_NUMBER column with unique number ,taking into category column consideration.
Here is the table structure and data.
{code}
create table sample(
CATEGORY VARCHAR2(100),
NUMBER VARCHAR2(100),
NEW_NUMBER VARCHAR2(100))
{code}
{code}
insert into sample values('CAPACITOR','36858','');
insert into sample values('CAPACITOR','37858','');
insert into sample values('CAPACITOR','36958','');
insert into sample values('RESISTOR','46858','');
insert into sample values('RESISTOR','47858','');
insert into sample values('RESISTOR','46958','');
{code}
I have to update the NEW_NUMBER column with unique number ,taking into category column consideration.
Output would be like this.
{code}
insert into sample values('CAPACITOR','36858','270-01-0000001');
insert into sample values('CAPACITOR','37858','270-01-0000002');
insert into sample values('CAPACITOR','36958','270-01-0000003');
insert into sample values('RESISTOR','46858','370-01-0000001');
insert into sample values('RESISTOR','47858','370-01-0000002');
insert into sample values('RESISTOR','46958','370-01-0000003');
{code}
If you can help to generate for one category,I will do it for other categories.
Thanks in advance.
Thanks,
LakNot sure how you came up with 270 and 370. But with what ever information you have provided this is what i came up with.
SQL> select * from sample;
CATEGORY OLD_NUMBER NEW_NUMBER
CAPACITOR 36858
CAPACITOR 37858
CAPACITOR 36958
RESISTOR 46858
RESISTOR 47858
RESISTOR 46958
6 rows selected.
SQL> merge into sample a
2 using (
3 select category
4 , old_number
5 , decode(category, 'CAPACITOR', '270', 'RESISTOR', '370')
6 || '-01-'
7 || lpad
8 (
9 row_number() over(partition by category order by old_number)
10 , 7
11 , '0'
12 ) new_number
13 from sample
14 ) b
15 on (
16 a.category = b.category and
17 a.old_number = b.old_number
18 )
19 when matched then
20 update set a.new_number = b.new_number;
6 rows merged.
SQL> select * from sample order by category, old_number;
CATEGORY OLD_NUMBER NEW_NUMBER
CAPACITOR 36858 270-01-0000001
CAPACITOR 36958 270-01-0000002
CAPACITOR 37858 270-01-0000003
RESISTOR 46858 370-01-0000001
RESISTOR 46958 370-01-0000002
RESISTOR 47858 370-01-0000003
6 rows selected. -
Help needed for PK_REV_COL unique constraint violation
We’re receiving a SNPW.PK_REV_COL unique constraint violation when trying to reverse a pipe delimited source file. There are no duplicate column names within the source file but the same column names are used across several different input files. Does anyone have a solution to this problem?
Hi,
This is a problem with the Reversed tables from ODI.
Go to work repository and truncate any "snp_rev...." tables.
That should solves it.
Cezar Santos
[www.odiexperts.com]
Edited by: Cezar Santos - www.odiexperts.com on 20/10/2009 15:34 -
Need to filter unique columns based on other column's values
I'm rookie and I'm running this query:
SELECT TO_NUMBER (hs_key) bug, "HS_TABLE_NAME", "HS_COLUMN_NAME",
"HS_CHANGE_DATE", "HS_CHANGE_TIME", "HS_CHANGER", "HS_NEW_VALUE"
FROM cb_tdqatodo1_history
WHERE (hs_column_name) = 'BG_STATUS'
AND (hs_new_value) LIKE '%Not a Bug'
AND (hs_change_date, hs_key) IN (
SELECT MAX (hs_change_date) hs_change_date,
hs_key
FROM cb_tdqatodo1_history
GROUP BY hs_key);
The result is
BUG HS_TABLE_NAME HS_COLUMN_NAME HS_CHANGE_DATE HS_CHANGE_TIME HS_CHANGER HS_NEW_VALUE
101 BUG BG_STATUS 12/16/2005 17:49:54 helpdesk Closed Not a Bug
101 BUG BG_STATUS 12/16/2005 12:20:22 hgarcia Not a Bug
1012 BUG BG_STATUS 1/21/2005 08:04:56 helpdesk Not a Bug
1014 BUG BG_STATUS 2/1/2005 14:33:56 lossa Not a Bug
1020 BUG BG_STATUS 1/28/2005 17:04:45 fgonzalez Not a Bug
I need to resolve the cases when the field BUG has the same value in HS_CHANGE_DATE but different value in HS_CHANGE_TIME without impact the rest of the records?
In this case I need the result just show me one Bug per line.
ThanksBasically you want to create two filters on different columns and have OR clause between them instead of an AND. To acheive this, add both of your filters, once added you will the them in the filters section. Click on AND, and it will change to OR. This should solve your problem.
Look at the below image where you can see two filters with an AND clause. Clicking on AND will change it into OR.
http://gerardnico.com/wiki/_media/dat/obiee/presentation_service/obiee_filters.jpg
Close thread and award points please.
Thanks,
-Amith. -
Composite unique constraint on parent and child values?
Is it possible to have a composite unique constraint containing values from child elements? The below example has the 'child' elements are out-of-line but this is preferred but optional, as I know you cannot have a unique constraint across tables without having a reference table containing the constraint and both columns. How does xdb handle this requirement?
allowed:
<parent ID="1">
<child><name>test1</name></child>
<child><name>test2</name></child>
</parent>
<parent ID="2">
<child><name>test1</name></child>
<child><name>test2</name></child>
</parent>not allowed:
<parent ID="1">
<child><name>test1</name></child>
<child><name>test1</name></child>
</parent>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
xdb:storeVarrayAsTable="true"
elementFormDefault="qualified">
<xs:element name="parent" type="Parent_T"
xdb:columnProps="CONSTRAINT parent_pkey PRIMARY KEY (XMLDATA.ID)"
xdb:defaultTable="PARENT"/>
<xs:complexType name="Parent_T" xdb:SQLType="PARENT_T" xdb:maintainDOM="false">
<xs:sequence>
<xs:element name="child" type="Child_T" minOccurs="1" maxOccurs="unbounded" xdb:SQLName="CHILD"
xdb:SQLInline="false" xdb:defaultTable="CHILD" "/>
</xs:sequence>
<xs:attribute name="ID" xdb:SQLName="ID" use="required" />
</xs:complexType>
<xs:complexType name="Child_T" xdb:SQLType="CHILD_T">
<xs:sequence>
<xs:element name="name" type="xs:string" xdb:SQLName="NAME"/>
</xs:sequence>
</xs:complexType>
</xs:schema>xdb:columnProps="CONSTRAINT parent_pkey PRIMARY KEY (XMLDATA.ID),*UNIQUE(XMLDATA.CHILD.NAME)*" raises nonexistant attribute
One possible solution would be to copy the value of the parent primary key to the child element, then I could create a composite unique constraint using only values from the child. However, I have this same requirement elsewhere in my schema nested further down, and it may become messy / bad design having to cascade all the primary keys down the schema. For example I have a recursive element in which two attributes need to be unique only within the parent:
<parent id="1">
<child a="1" b="1">
<child a="1" b="2">
<child a="1" b="1" /> *not allowed
</child>
</child>
<child a="1" b="2" /> *not allowed
</parent>Possible fix:
<child a="1" b="2" parent_id="1" />
<xs:complexType name="Child_T>
<xs:sequence>
<xs:element name="child" xsd:SQLInline="false" xsd:columnProps="UNIQUE(XMLDATA.a,XMLDATA.b,XMLDATA.parent_id)" minOccurs="0" maxOccurs="unbounded" type="Child_T">
</xs:sequence>
</xs:element
</xs:complexType>Is there a better design?
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - ProductionYou can do something like this :
SQL> DECLARE
2
3 xsd_doc xmltype := xmltype('<?xml version="1.0" encoding="utf-8"?>
4 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
5 <xs:element name="name" xdb:SQLType="VARCHAR2">
6 <xs:simpleType>
7 <xs:restriction base="xs:string">
8 <xs:maxLength value="30"/>
9 </xs:restriction>
10 </xs:simpleType>
11 </xs:element>
12 <xs:element name="child" xdb:SQLType="CHILD_T">
13 <xs:complexType xdb:SQLType="CHILD_T" xdb:maintainDOM="false">
14 <xs:sequence>
15 <xs:element ref="name"/>
16 </xs:sequence>
17 </xs:complexType>
18 </xs:element>
19 <xs:element name="parent" xdb:SQLType="PARENT_T">
20 <xs:complexType xdb:SQLType="PARENT_T" xdb:maintainDOM="false">
21 <xs:sequence>
22 <xs:element ref="child" maxOccurs="unbounded" xdb:SQLCollType="CHILD_COLL"/>
23 </xs:sequence>
24 <xs:attribute name="ID" type="xs:integer" use="required"/>
25 </xs:complexType>
26 </xs:element>
27 <xs:element name="root" xdb:defaultTable="MY_XML_TABLE" xdb:SQLType="ROOT_T">
28 <xs:complexType xdb:SQLType="ROOT_T" xdb:maintainDOM="false">
29 <xs:sequence>
30 <xs:element ref="parent" maxOccurs="unbounded" xdb:SQLCollType="PARENT_COLL"/>
31 </xs:sequence>
32 </xs:complexType>
33 </xs:element>
34 </xs:schema>');
35
36 BEGIN
37
38 dbms_xmlschema.registerSchema(
39 schemaURL => 'test_parent.xsd',
40 schemaDoc => xsd_doc,
41 local => true,
42 genTypes => true,
43 genbean => false,
44 genTables => false,
45 enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
46 );
47
48 END;
49 /
PL/SQL procedure successfully completed
SQL> CREATE TABLE my_xml_table OF XMLTYPE
2 XMLTYPE STORE AS OBJECT RELATIONAL
3 XMLSCHEMA "test_parent.xsd"
4 ELEMENT "root"
5 VARRAY xmldata."parent" STORE AS TABLE my_parent_tab
6 (
7 VARRAY "child" STORE AS TABLE my_child_tab
8 )
9 ;
Table created
SQL> ALTER TABLE my_parent_tab ADD CONSTRAINT parent_uk UNIQUE (nested_table_id, "ID");
Table altered
SQL> ALTER TABLE my_child_tab ADD CONSTRAINT child_uk UNIQUE (nested_table_id, "name");
Table altered
Then :
SQL> insert into my_xml_table values (
2 xmltype('<root><parent ID="1">
3 <child><name>test1</name></child>
4 <child><name>test2</name></child>
5 </parent>
6 <parent ID="1">
7 <child><name>test1</name></child>
8 <child><name>test2</name></child>
9 </parent></root>')
10 );
insert into my_xml_table values (
ERREUR à la ligne 1 :
ORA-00001: violation de contrainte unique (DEV.PARENT_UK)
SQL> insert into my_xml_table values (
2 xmltype('<root><parent ID="1">
3 <child><name>test1</name></child>
4 <child><name>test1</name></child>
5 </parent>
6 <parent ID="2">
7 <child><name>test1</name></child>
8 <child><name>test2</name></child>
9 </parent></root>')
10 );
insert into my_xml_table values (
ERREUR à la ligne 1 :
ORA-00001: violation de contrainte unique (DEV.CHILD_UK)
SQL> insert into my_xml_table values (
2 xmltype('<root><parent ID="1">
3 <child><name>test1</name></child>
4 <child><name>test2</name></child>
5 </parent>
6 <parent ID="2">
7 <child><name>test1</name></child>
8 <child><name>test2</name></child>
9 </parent></root>')
10 );
1 ligne créée.http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb06stt.htm#sthref987 -
Hi, I have jdk1.4. and I need to generate unique long ID for each client which will be transported from server to client and vise versa . As I see, J2SE has the next classes which may be useful to me: Random and SecureRandom.
What and why is better to use? Maybe it is better use another class or maybe external library? May you give me an advise. May you also give a link to specific article if you know. Thank you in advance.SecureRandom is slower and non-deterministic. The speed often doesn't matter at all and the non-determinismus may be what you want.
Random is quite simple - if you suppose somebody trying to guess the IDs, than do not use Random.
Explain your needs in more detail, tell us if you need deteminismus or not. -
Difference between Unique key and Unique index
Hi All,
I've got confused in the difference between unique index & unique key in a table.
While we create a unique index on a table, its created as a unique index.
On the other hand, if we create a unique key/constraint on the table, Oracle also creates an index entry for that. So I can find the same name object in all_constraints as well as in all_indexes.
My question here is that if during creation of unique key/constraint, an index is automatically created than why is the need to create unique key and then two objects , while we can create only one object i.e. unique index.
Thanks
DeepakThis is only my understanding and is not according to any documentation, that is as follows.
The unique key (constraint) needs an unique index for achieving constraint of itself.
Developers and users can make any constraint (unique-key, primary-key, foreign-key, not-null ...) to enable,disable and be deferable. Unique key is able to be enabled, disabled, deferable.
On the other hand, the index is used for performance-up originally, unique index itself doesn't have the concept like constraints. The index (including non-unique, unique) can be rebuilded,enabled,disabled etc. But I think that index cannot be set "deferable-builded" automatic. -
INDEX UNIQUE SCAN instead of INDEX FULL SCAN or TABLE ACCESS FULL
I have calculated statistics in all tables and indexes
I have a table and a view and when I put it
SELECT *
FROM TABLE_A A
INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID
WHERE (B.FK_ID_XXX = 1)
If I see the execution plan:
In TABLE_A make a
TABLE ACCESS BY INDEX ROWID
INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
Itâs OK. I NEED IT (INDEX UNIQUE SCAN)
But If I put
SELECT A.Field_1, A.Field_2, A.Field_3, A.Field_4
FROM TABLE_A A
INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID
WHERE (B.FK_ID_XXX = 1)
In table A make a TABLE ACCESS FULL.
Then If I put:
SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
FROM TABLE_A A
INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID
WHERE (B.FK_ID_XXX = 1)
If I see the execution plan:
In TABLE_A make a
TABLE ACCESS BY INDEX ROWID
INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
Itâs OK. I NEED IT (INDEX UNIQUE SCAN)
Finally, If I put other tables and views in the query (I NEED IT)
For example:
SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
FROM TABLE_A A
INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID
INNER JOIN TABLE_Câ¦.
LEFT JOIN VIEW_Dâ¦.
WHERE (B.FK_ID_XXX = 1)
If I see the execution plan:
In TABLE_A make a
TABLE ACCESS BY INDEX ROWID
INDEX FULL SCAN (FIELD_A_TABLE_A_PK)
I need INDEX UNIQUE SCAN instead of INDEX FULL SCAN or TABLE ACCESS FULL.
How can obtain it?
What happens???
Thanks!Notice the difference in cardinality between your two select statements:
SELECT STATEMENT, GOAL = ALL_ROWS Cost=5 Cardinality=1
SELECT STATEMENT, GOAL = ALL_ROWS Cost=10450 Cardinality=472161Apparently since the optimizer believed the first statement was going to return one row, it used an index. But in the second statement it believed it was going to return nearly the whole table (didn't you say it had around 500k rows?). Hence full table scan.
Maybe you are looking for
-
Why won't my iPhone 5c connect to the internet without wi-fi?
This is so strange, but I can't use my iPhone 5c apps when I'm not connected to wifi. This makes no sense because I have a data plan. It's not unlimited, but I've already checked with my carrier, and my data for the month has barely been used. The in
-
AVCHD wont open with Quicktime player
I'm using the sony handy cam. Plugged it into the computer and tried selecting all four options on the camcorder (USB connect... etc.) two of them came up with a file AVCHD. I clicked on it and it opened a new window that appeared to be loading, and
-
Mac compatibility with 'Novell Groupwise' PC network
Hi all I'm currently working on a PC, but my company is 'looking into' buying me and my colleague Macs (We're the Graphic Designers for a large organisation). I've worked on Macs for 15+ years. However, the company uses 'Novell Groupwise' for all its
-
Passing values at run time through a JSP page to selection formula to crystal report
<p>hi,</p><p> i am using one jsp page.in that page there is a field to select a date </p><p>this value will go to the report and report contain one selection formula.</p><p>which value we are passing on that basis the report should display</p><p>wi
-
Trying to upgrade Os from 10.5.8 to snow leopard
I am trying to upgrade OS and have 10.5.8 I have a disc for snow leopard but it says it cannot be installed on this computer - how do I get up to date?