Java OracleXML putXML & non-unique keys
I am using the XML SQL Utility for java on the client (NT) to insert multi-row XML documents into an ORACLE table. Everything works fine until I hit a row with a non-unique key. It appears insertXML throws an error and the insert stops at that point. Rows after the non-unique key row are not processed.
Is there any way to process all rows of an XML document, telling me how many read, how many inserted, how many not processed??
Also, what about update capabilities? Presently I am not needing to update from XML into ORACLE, all I can do now is insert.
Thanks in advance,
Rick
One way to make this work would be to take advantage of Oracle8i's INSTEAD OF triggers on views.
Basically, you would:
(1) CREATE VIEW someview
AS SELECT * FROM sometable;
(2) CREATE TRIGGER someview_trig
INSTEAD OF INSERT ON someview
DECLARE
BEGIN
-- Check for existence of
-- row using the value of
-- :NEW.pk_column_name
IF (you-found-an-existing-one) THEN
-- Do something here like
-- NULL; to ignore the insert altogether
-- or possible an INSERT into
-- and EXCEPTIONS table...
ELSE
INSERT INTO sometable
VALUES (:NEW.column1, ..., :NEW.columnn);
END IF;
END;
(3) Then point XML SQL Utility at someview
instead of sometable
and you'll be in business, as they say.
Similar Messages
-
Display columns as rows from non-unique key table
Hi OTN/Users, I hope you can assist me
Given a table:
create table t (a varchar2(30), b int, c date );
with this data within:
insert into t values ( a1, 40, to_date( '01-Dec-2012'));
insert into t values ( a1, 50, to_date( '01-Dec-2012'));
insert into t values ( a1, 60, to_date( '01-Dec-2012'));
insert into t values ( b1, 10, to_date( '01-Dec-2012'));
insert into t values ( b1, 20, to_date( '01-Dec-2012'));
insert into t values ( b1, 30, to_date( '01-Dec-2012'));
insert into t values ( c1, 60, to_date( '01-Dec-2012'));
insert into t values ( c1, 70, to_date( '01-Dec-2012'));
insert into t values ( c1, 80, to_date( '01-Dec-2012'));
- I want to output the columns for each of 'a' as a single row e.g:
a1 40 50 60 01-Dec-2012
b1 10 20 30 01-Dec-2012
I've almost got it right, but the 'a' col repeats 4 times for each row of output:
a1 40
a1 50
a1 60
a1 01-Dec-2012
-I want to supress repeat output of the first column 'a' but display the rest in a straight line.
I've tried various things (Pivot, Rollup etc), but the fact i'm keying on a table with non unique rows has complicated things perhaps.
Any help would be much appreciatedHi,
Pre-11g this is how you would do it :[11.2] Pri @ Bepripd1 > !cat t.sql
with t(a,b,c) as (
select 'a1', 40, to_date( '01-Dec-2012') from dual union all
select 'a1', 50, to_date( '01-Dec-2012') from dual union all
select 'a1', 60, to_date( '01-Dec-2012') from dual union all
select 'b1', 10, to_date( '01-Dec-2012') from dual union all
select 'b1', 20, to_date( '01-Dec-2012') from dual union all
select 'b1', 30, to_date( '01-Dec-2012') from dual union all
select 'c1', 60, to_date( '01-Dec-2012') from dual union all
select 'c1', 70, to_date( '01-Dec-2012') from dual union all
select 'c1', 80, to_date( '01-Dec-2012') from dual
------ end of sample data ------
select
a
,max(decode(n,1,b,null)) q1
,max(decode(n,2,b,null)) q2
,max(decode(n,3,b,null)) q3
,c
from (
select a, b, c, row_number() over (partition by a order by b) n
from t
group by a,c
order by a,c
[11.2] Pri @ Bepripd1 > @t
A Q1 Q2 Q3 C
a1 40 50 60 01/12/2012 00:00:00
b1 10 20 30 01/12/2012 00:00:00
c1 60 70 80 01/12/2012 00:00:00------
From 11g onward, you would :[11.2] Pri @ Bepripd1 > !cat t.sql
with t(a,b,c) as (
select 'a1', 40, to_date( '01-Dec-2012') from dual union all
select 'a1', 50, to_date( '01-Dec-2012') from dual union all
select 'a1', 60, to_date( '01-Dec-2012') from dual union all
select 'b1', 10, to_date( '01-Dec-2012') from dual union all
select 'b1', 20, to_date( '01-Dec-2012') from dual union all
select 'b1', 30, to_date( '01-Dec-2012') from dual union all
select 'c1', 60, to_date( '01-Dec-2012') from dual union all
select 'c1', 70, to_date( '01-Dec-2012') from dual union all
select 'c1', 80, to_date( '01-Dec-2012') from dual
------ end of sample data ------
select a,q1,q2,q3,c
from (
select a, b, c, row_number() over (partition by a order by b) n
from t
pivot (
max(b)
for n in (
1 as q1
,2 as q2
,3 as q3
order by a,c
[11.2] Pri @ Bepripd1 > @t
A Q1 Q2 Q3 C
a1 40 50 60 01/12/2012 00:00:00
b1 10 20 30 01/12/2012 00:00:00
c1 60 70 80 01/12/2012 00:00:00Edited by: Nicosa on Nov 9, 2012 2:42 PM -
XML to SQL conversion using OracleXML putXML
Hi,
How many rowTag values can I use when I use OracleXML putXML ? I have an XML file in the following format.
I have to use "ABC" as rowTag. What Can I do with "GRANT_ROW" ? I have a table with
R_DATE and
GRANT columns
where GRANT is an object type with elements
NAME and ATYPE.
Thanks.
<?xml version = '1.0'?>
<EXCH>
<ABC num="1">
<R_DATE>5/21/2003 0:0:0</R_DATE>
<GRANT>
<GRANT_ROW num="1">
<NAME>GUNACAR</NAME>
<ATYPE>TE</ATYPE>
</GRANT_ROW>
<GRANT_ROW num="2">
<NAME>GUNACAR</NAME>
<TYPE>TE</TYPE>
</GRANT_ROW>
</GRANT>
</ABC>
</EXCH>
I get the following error when I run
java OracleXML putXML ....
oracle.xml.sql.OracleXMLSQLException: 'The XML element tag 'GRANT_ROW'
does not match the name of any of the columns/attributes of the
target database object.' encountered during processing ROW element 0.
Thanks....RTF FormattingKit
http://www.schema.de/sitehtml/site-e/xmlnach0.htm -
I upgraded the Oracle XML SQL Utility from 1.1.1 to 1.2 (and changed my ClassPath to use classes12.zip). When I run OracleXML putXML, rows are getting inserted into my table, but I'm getting the following error. Should I worry about it? I did not get this error message with XSU111. Thanks.
========================================
E:\vj\Test>java OracleXML putXML -user scott/tiger -fileName test-out_MANUAL.xml
t1
A nonfatal internal JIT (3.10.107(x)) error 'Structured Exception(c0000005)' has
occurred in :
'oracle/xml/sql/dml/OracleXMLSave.cleanLobList ()V': Interpreting method.
Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi
successfully inserted 3 rows into t1
========================================Please ignore this posting. My classpath was messed up. It's resolved.
-
Can I have a primary key as a non-unique column
Hi all,
I have a table with 35 columns and only one column in a not null column. But this column data is not unique. I want to create a primary key with non-unique index, can I don it, if it is not possible is there any other way to it. Please help me with this.
Thanks for your help.vinaykotha1) Do the 'Unique Column combination' check first, using this example. (Pl. Change the column name and number of columns you consider as candidate key.) The SQL as follows:-
;WITH CTE (ProductKey, CustomerKey, SalesTerritoryKey, DupRec)
AS
(SELECT ProductKey, CustomerKey, SalesTerritoryKey, ROW_NUMBER() OVER
(PARTITION BY ProductKey, CustomerKey, SalesTerritoryKey
ORDER BY ProductKey, CustomerKey, SalesTerritoryKey) AS DupRec
FROM dbo.FactSales
SELECT *
FROM CTE
WHERE DupRec > 1
2) if CTE Table returns no records, you are good to create a Composite CLUSTERED PRIMARY KEY, like:
ALTER TABLE dbo.FactSales
ADD CONSTRAINT PK_ProductKey_CustomerKey_SalesTerritoryKey
PRIMARY KEY CLUSTERED (ProductKey, CustomerKey, SalesTerritoryKey);
If no error..bingo! if NOT, Don't worry, create a Composite Index like this:-
3)
CREATE NONCLUSTERED INDEX [IX_ProductKey_CustomerKey_SalesTerritoryKey]
ON dbo.FactSales(ProductKey, CustomerKey, SalesTerritoryKey);
This will work still efficiently. Usually all transaction table are like that like Daily_Order table, Ship_Details table etc.
-NC -
Primary Key supported by a non-unique index?
Encountered a weird situation today. A utility we setup which allows Analysts to restore data into their tables, started failing when it attempted to drop an index. The index was supporting a Primary Key. Makes sense. But our script was supposed to only be attempting to drop/recreate non-unique indexes. Turns out the supporting index on the Primary Key was non-unique, and to the best of my knowledge came about as follows:
SQL> create table junk (f number(1));
Table created.
SQL> create index junk_ix on junk(f);
Index created.
SQL> select UNIQUENESS from DBA_INDEXES where index_name = 'JUNK_IX';
UNIQUENES
NONUNIQUE
SQL> alter table forbesc.junk add constraint junk_pk primary key (f) using index junk_ix;
Table altered.
SQL> select UNIQUENESS from DBA_INDEXES where index_name = 'JUNK_IX';
UNIQUENES
NONUNIQUE
SQL> insert into junk values (1);
1 row created.
SQL> insert into junk values (1);
insert into junk values (1)
ERROR at line 1:
ORA-00001: unique constraint (FORBESC.JUNK_PK) violated
SQL> select index_name from dba_constraints where constraint_name = 'JUNK_PK';
INDEX_NAME
JUNK_IXWhat I can't figure out is how a non-unique index is enforcing uniqueness. I thought that it was the key in that very same process. I thought that perhaps an index with the 'SYS_123456' was getting created, perhaps, but I couldn't find one:
SQL> select object_name, object_type from dba_objects order by created desc;
OBJECT_NAME OBJECT_TYPE
JUNK_IX INDEX
JUNK TABLE
...How is the uniqueness getting enforced in this case? This is in Oracle 11.1.0.7
Thanks,
--=ChuckIt has always been that way. Oracle can, and will, use a non-unique index to enforce a PK constraint, The existing index just needs to have the PK column(s) as the leading column(s) of the index:
SQL> create table t (id number, id1 number, descr varchar2(10));
Table created.
SQL> create index t_ids on t(id, id1);
Index created.
SQL> select index_name from user_indexes
2 where table_name = 'T';
INDEX_NAME
T_IDS
SQL> alter table t add constraint t_pk
2 primary key (id);
Table altered.
SQL> select index_name from user_indexes
2 where table_name = 'T';
INDEX_NAME
T_IDS
SQL> insert into t values (1, 1, 'One');
1 row created.
SQL> insert into t values (1, 2, 'Two');
insert into t values (1, 2, 'Two')
ERROR at line 1:
ORA-00001: unique constraint (OPS$ORACLE.T_PK) violatedJohn -
OWB Dataprofiling - Unique Key Analysis on non-number columns
Does anyone know an easy way to enable unique key analysis on non-Number columns (OWB 10.2.0.3).
It seems that the profiler by default disables the
'Use in relationsship discovery' when the documented datatype is non-Number.
Is this a setting which can be configured for OWB, or is there a smart way to set this property for all columns?
thks in advanceHi don't think there is a way to to automatically switch this on/off, a small script can be created to set the option on/off for all columns in the table.
Cheers
David -
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. -
WHat is the best index type for non uniqueness / Varchar columns in SQL 2008 R2
Hello All Greetings,
Please help me here with my doubt,
in my table i have two columns about a million rows, it has about 20 columns in it, three columns with name as Period, Gender so most of the time these two columns use in where clause,
Gender will contain Either M or F , Period contains YYYY-Month (2013-December, 2013-August) etc so i would like to add a Index to these two columns so that in will increase the performance, so please let me know what type of indexes i need to add to
these columns in the table,
please note that only one time we will add data to the table which will take only 2 minutes but we query the table every day
so my question what is the best index type that i need to create on columns with non uniqueness values in the column.,
Thank you In Advance,
MilanThere is nothing whatever wrong with creating an index on a VARCHAR column, or set of columns.
Regarding the performance of VARCHAR/INT, as with everything in a RDBMS, it depends on what you are doing. What you may be thinking of is the fact that clustering a table on a VARCHAR key is (in SQL Server) marginally less efficient than clustering on a monotonically
increasing numerical key, and can introduce fragmentation.
Or you may be thinking of what you have heard about writing JOINs on VARCHAR columns - it is true, it is a little less efficient than a JOIN on numeric type, but it is only a little less efficient, nothing that would lead you to never join on varchar cols.
None of this does not mean that you should not create indexes on VARCHAR columns. A needed index on a VARCHAR column will boost query performance, often by orders of magnitude. If you need an index on a VARCHAR, create it. It makes no sense to try to find an
integer column to create the index on - the engine will never use it.
Check this reference: http://stackoverflow.com/questions/14041481/is-it-good-to-create-a-nonclustered-index-on-a-column-of-type-varchar
Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
INSQLSERVER.COM
Mohammad Nizamuddin -
How to generate a Unique key based on a some String value
Hello every one,
I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..
For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..
Is there any way we can get the unique value using Java ?
ThanksMay be not what you are looking for, but here's may idea:
use a sequence (db sequence) and add it the the string value. This way the value is unique, because the sequence is unique. So you could omit the string theoretically, but your requirement is met.
It's very easy to get a unique sequence number from the db using java, depending of the technology you use (which you did not say :-( )
Timo -
Unique Key Violation While Doing Multiple Updates And Create in EJB
Hello All,
I am using oracle 9i and Weblogic 7.0. I have a table that has a unique key constraint on one column , say 'Col1' and i am using a CMP to read,create and update data in this table. The problem description is as follows.
I have JTable that display the data from the above said table. The user can modify the existing data and insert new data that will be reflected in the DB using the CMP. Let us say the following are displayed
ROW1
Col1 : 3
Col2 : 'ABC'
Col3 : 1 (Primary key in the table)
Now the user modifies the above row and inserts a new record. Now the following will be the display
ROW1 (Modified)
Col1 : 4
Col2 : 'ABC'
Col3 : 1 (Primary key in the table)
ROW2 (New)
Col1 : 3
Col2 : 'DEF'
Col3 : 2 (Primary key in the table)
When the above data is saved i do the following in the Code
a) Session Bean
For (all the data in the Jtable)
try
home.findByPrimaryKey(Col3);
remote.update(Col1,Col2);
catch(FinderException fe)
home.create(Col1,Col2,Col3);
When the above code is run During the first loop the update runs succesfully (i.e update old value of 3 with 4 ) but during the 2nd loop the create (i.e Insert new value 3) gives me the unique key violated exception. The following is the stack trace
<Oct 25, 2004 11:36:22 AM IST> <Info> <EJB> <010049> <EJB Exception in method: ejbPostCreate: java.sql.SQLException: ORA-00001: unique constraint (UAT_CYCLE2_1.UK_PYMT_DET_TX) violated
java.sql.SQLException: ORA-00001: unique constraint (UAT_CYCLE2_1.UK_PYMT_DET_TX) violated
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1892)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2130)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2013)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2869)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:509)
at de.dl.ucs.contract.entity.TerminalPaymentsCMP_kbdoop__WebLogic_CMP_RDBMS.__WL_create(TerminalPaymentsCMP_kbdoop__WebLogic_CMP_RDBMS.java:1435)
at de.dl.ucs.contract.entity.TerminalPaymentsCMP_kbdoop__WebLogic_CMP_RDBMS.ejbPostCreate(TerminalPaymentsCMP_kbdoop__WebLogic_CMP_RDBMS.java:1353)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:1023)
at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:904)
at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:180)
at de.dl.ucs.contract.entity.TerminalPaymentsCMP_kbdoop_LocalHomeImpl.create(TerminalPaymentsCMP_kbdoop_LocalHomeImpl.java:73)
at de.dl.ucs.contract.helperclasses.SubsegmentMaintanence.saveTerminalPayments(SubsegmentMaintanence.java:697)
at de.dl.ucs.contract.controller.SubsegmentSL.saveSubsegmentDetails(SubsegmentSL.java:570)
at de.dl.ucs.contract.controller.SubsegmentSL.processFinanceSubsegmentSave(SubsegmentSL.java:1601)
at de.dl.ucs.contract.controller.SubsegmentSL_kgzv4j_EOImpl.processFinanceSubsegmentSave(SubsegmentSL_kgzv4j_EOImpl.java:498)
at de.dl.ucs.contract.events.FinanceSubsegmentBEH.saveSubsegmentDetails(FinanceSubsegmentBEH.java:749)
at de.dl.ucs.contract.events.FinanceSubsegmentBEH.processEvent(FinanceSubsegmentBEH.java:232)
at de.dl.ucs.framework.flowcontroller.ControllerBean.delegateAction(ControllerBean.java:229)
at de.dl.ucs.framework.flowcontroller.ControllerBean_riqvk4_EOImpl.delegateAction(ControllerBean_riqvk4_EOImpl.java:46)
at de.dl.ucs.framework.flowcontroller.ControllerBean_riqvk4_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:441)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:382)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:726)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:377)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
>
<Oct 25, 2004 11:36:22 AM IST> <Info> <EJB> <010051> <EJB Exception during invocation from home: [email protected] threw exception: javax.ejb.TransactionRolledbackLocalException: EJB Exception:; nested exception is: java.sql.SQLException: ORA-00001: unique constraint (UAT_CYCLE2_1.UK_PYMT_DET_TX) violated
Please help me with this, as far as i am concerned since both update and create is in the same transaction the update on the row must be visible to the create and hence there shouild not be any problem.....
thanks in advance
ShankiHi,
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 -
Unique Key Violation error while updating table
Hi All,
I am having problem with UNIQUE CONSTRAINT. I am trying to update a table and getting the violation error. Here is the over view. We have a table called ActivityAttendee. ActivityAttendee has the following columns. The problem to debug is this table has
over 23 million records. How can I catch where my query is going wrong?
ActivityAttendeeID INT PRIMARY KEY IDENTITY(1,1)
,ActivityID INT NOT NULL (Foreign key to parent table Activity)
,AtendeeTypeCodeID INT NOT NULL
,ObjectID INT NOT NULL
,EmailAddress VARCHAR(255) NULL
UNIQUE KEY is on ActivityID,AtendeeTypeCodeID,ObjectID,EmailAddress
We have a requirement where we need to update the ObjectID. There is a new mapping where I dump that into a temp table #tempActivityMapping (intObjectID INT NOT NULL, intNewObjectID INT NULL)
The problem is ActivityAttendee table might already have the new ObjectID and the unique combination.
For example: ActivityAttendee Table have the following rows
1,1,1,1,NULL
2,1,1,2,NULL
3,1,1,4,'abc'
AND the temp table has 2,1
So essentially when I update in this scenario, It should ignore the second row because, if I try updating that there will be a violation of key as the first record has the exact value. When I ran my query on test data it worked fine. But for 23 million records,
its going wrong some where and I am unable to debug that. Here is my query
UPDATE AA
SET AA.ObjectID = TMP.NewObjectID
FROM dbo.ActivityAttendee AA
INNER JOIN #tmpActivityMapping TMP ON AA.ObjectID = TMP.ObjectID
WHERE TMP.NewObjectID IS NOT NULL
AND NOT EXISTS(SELECT 1
FROM dbo.ActivityAttendee AA1
WHERE AA1.ActivityID = AA.ActivityID
AND AA1.AttendeeTypeCodeID = AA.AttendeeTypeCodeID
AND AA1.ObjectID = TMP.NewObjectID
AND ISNULL(AA1.EmailAddress,'') = ISNULL(AA.EmailAddress,'')>> I am having problem with UNIQUE CONSTRAINT. I am trying to update a table and getting the violation error. Here is the over view. We have a table called Activity_Attendee. <<
Your problem is schema design. Singular table names tell us there is only one of them the set. Activities are one kind of entity; Attendees are a totally different kind of entity; Attendees are a totally different kind of entity. Where are those tables? Then
they can have a relationship which will be a third table with REFERENCES to the other two.
Your table is total garbage. Think about how absurd “attendee_type_code_id” is. You have never read a single thing about data modeling. An attribute can be “attendee_type”, “attendee_code” or “attendee_id”but not that horrible mess. I have used something like
this in one of my busk to demonstrate the wrong way to do RDBMS as a joke, but you did it for real. The postfix is called an attribute property in ISO-11179 standards.
You also do not know that RDBMS is not OO. We have keys and not OIDs; but bad programmers use the IDENTITY table property (NOT a column!), By definition, it cannot be a key; let me say that again, by definition.
>> ActivityAttendee has the following columns. The problem to debug is this table has over 23 million records [sic: rows are not records]<<
Where did you get “UNIQUE KEY” as syntax in SQL?? What math are you doing the attendee_id? That is the only reason to make it INTEGER. I will guess that you meant attendee_type and have not taken the time to create an abbreviation encoding it.
The term “patent/child” table is wrong! That was network databases, not RDBMS. We have referenced and referencing table. Totally different concept!
CREATE TABLE Attendees
(attendee_id CHAR(10) NOT NULL PRIMARY KEY,
attendee_type INTEGER NOT NULL --- bad design.
CHECK (attendee_type BETWEEN ?? AND ??),
email_address VARCHAR(255),
CREATE TABLE Activities
(activity_id CHAR(10) NOT NULL PRIMARY KEY,
Now the relationship table. I have to make a guess about the cardinally be 1:1, 1:m or n:m.
CREATE TABLE Attendance_Roster
(attendee_id CHAR(10) NOT NULL --- UNIQUE??
REFERENCES Attendees (attendee_id),
activity_id Activities CHAR(10) NOT NULL ---UNIQUE??
REFERENCES Activities (activity_id)
PRIMARY KEY (attendee_id, activity_id), --- wild guess!
>> UNIQUE KEY is on activity_id, attendee_type_code_id_value_category, object_id, email_address <<
Aside from the incorrect “UNIQUE KEY” syntax, think about having things like an email_address in a key. This is what we SQL people call a non-key attribute.
>> We have a requirement where we need to update the ObjectID. There is a new mapping where I dump that into a temp table #tempActivityMapping (intObjectID INTEGER NOT NULL, intNewObjectID INTEGER NULL) <<
Mapping?? We do not have that concept in RDBMS. Also putting meta data prefixes like “int_” is called a “tibble” and we SQL people laugh (or cry) when we see it.
Then you have old proprietary Sybase UODATE .. FROM .. syntax. Google it; it is flawed and will fail.
Please stop programming until you have a basic understanding of RDBMS versus OO and traditional file systems. Look at my credits; when I tell you, I think I have some authority.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Problems Engineering Surrogate Primary Key with Unique Key
SDDM 3.3.0.747 with 2 problems (at least so far). I am hoping that the problem is with this SDDM rookie and I have overlooked some setting. PROBLEM 1 I don’t want to start a religious debate about surrogate vs. natural keys but I am having a problem engineering both correctly from the logical model. I am a rookie when it comes to SDDM but have many years of experience with Designer. By default I like to have both a natural UID (UK) and a surrogate key based primary UID (PK) which is used for foreign keys. The problem I am having with engineering is I can successfully engineer the surrogate PK’s, engineer the FK’s using the PK’s but cannot get the unique key to contain the surrogate keys in the child table. If I check the identifying property in the relations, the PK columns and the UK columns are included in the child PK and the UK contains no columns. The Setup I have defined two reference entities, PROBABILITY and SEVERITY with natural unique keys defined. I also have a child entity RISK_ASSESMENT with relationships back to the PROBABILITY and SEVERITY entities and both have the “Use surrogate keys:”: check box checked. The unique key for the RISK_ASSESMENT entity includes the relationships back to PROBILITY and SEVERITY. None of the entities have a PK or surrogate key defined and they all have the “Create Surrogate Key” check box checked. In addition the following preferences are set: Data Modeler/Model/Logical NOT Checked - Use And Set First Unique Key As Primary Key NOT Checked – Name – Keep as the name of the Originating attribute Checked – Entity Create Surrogate Key Checked – Relationship Use Surrogate Key PROBLEM 2 When the foreign key columns are engineered I want the names to have a prefix “FK_” but they don’t. Templates are set as follows: Data Modeler/Naming Standard/Templates Foreign Key: FK_{child}{parent} Column Foreign Key: FK_{ref column} Engineer to Relational Model/General Options Checked - Apply name translation Marcus Bacon
I have been switching between SD 4 EA1 and SDDM 3.3 trying to get things to work and trying out the template table for adding audit columns (really nice!).
Concerning Problem1. No matter what settings I use and whether I use SDDM 3.3 or SDI cannot get the FK columns to be included in the UK even though the relations are included in the UID in the entitty. When I open the properties of the child table and click on the naming standards button and click ok it complains that the UK is not complete. I add the FK columns to the UK and all is well including the naming standards.
Concerning Problem 2. Sometimes it engineers the names for FK's from the template and sometimes it doesn't. Didn't see a pattern. Gave up trying and used Naming Standards button. I still had to change a few.
The good new is, that after make changes needed in UK's and Column names of 18 tables, I know have everything deployed to Test except FK Indexes. I think I have to do those by hand.
Marcus Bacon -
Help : java.security.UnrecoverableKeyException: excess private key
Hi,
I require help for the exception "java.security.UnrecoverableKeyException: excess private key"
When i am trying to generate digital signature using PKCS7 format using bouncyCastle API, it gives the "java.security.UnrecoverableKeyException: excess private key" exception.
The full stack trace is as follows
------------------------------------------------------------------------java.security.UnrecoverableKeyException: excess private key
at sun.security.provider.KeyProtector.recover(KeyProtector.java:311)
at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:120)
at java.security.KeyStore.getKey(KeyStore.java:289)
at com.security.Security.generatePKCS7Signature(Security.java:122)
at com.ibm._jsp._SendSecureDetail._jspService(_SendSecureDetail.java:2282)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:93)
I had tested the program under following scenarios...
The Java Program for generating the digital signature independently worked successfully(without any change in policy files or java.security file) I have tested this independently on Sun's JDK 1.4, 1.6
For IBM JDK 1.4 on Windows machine for WAS(Webshere Application Server) 6.0, The Program for generating the digital signature using PKCS7 works fine, but it required IBM Policy files(local_policy.jar, US_export_policy.jar) and updation in java.security file
But the problem occurs in Solaris 5.10, WAS 6.0 where Sun JDK 1.4.2_6 is used.
I copied the unlimited strength policy files for JDK 1.4.2 from Sun's site(because the WAS 6.0 is running on Sun's JDK intead of IBM JDK)...
I changed the java.security file as follows(only changed content)
security.provider.1=sun.security.provider.Sun
security.provider.2=com.ibm.security.jgss.IBMJGSSProvider
security.provider.3=com.ibm.crypto.fips.provider.IBMJCEFIPS
security.provider.4=com.ibm.crypto.provider.IBMJCE
security.provider.5=com.ibm.jsse2.IBMJSSEProvider2
security.provider.6=com.ibm.jsse.IBMJSSEProvider
security.provider.7=com.ibm.security.cert.IBMCertPath
security.provider.8=com.ibm.security.cmskeystore.CMSProvider
I have used PKCS12(PFX) file for digital signature
which is same for all environment(i have described as above)
I copied the PFX file from windows to solaris using WinSCP in binary format so the content of certificate won't get currupted.
I can not change the certificate because it's given by the company and which is working in other enviroments absolutely fine(just i have described above)
I have gone though the "http://forums.sun.com/thread.jspa?threadID=408066" and other URLs too. but none of them helped...
So what could be the problem for such exception?????
I am on this issue since last one month...
I know very little about security.
Thanks in advance
PLEASE HELP ME(URGENT)
Edited by: user10935179 on Sep 27, 2010 2:47 AM
Edited by: user10935179 on Sep 27, 2010 2:54 AMuser10935179 wrote:
The Java Program for generating the digital signature independently worked successfully(without any change in policy files or java.security file) If the program was working fine without changing the java.security policy file, why have you changed it to put the IBM Providers ahead of the SunRsaSign provider?
While I cannot be sure (because I don't have an IBM provider to test this), the error is more than likely related to the fact that the IBM Provider implementations for handling RSA keys internally are different from the SunRsaSign provider. Since you've now forced the IBM provider ahead of the original Sun provider, you're probably running into interpretation issues of the encoded objects inside the keystore.
Change your java.security policy back to the default order, and put your IBM Providers at the end of the original list and run your application to see what happens.
Arshad Noor
StrongAuth, Inc. -
Hi,
How can I respond to input from non-standard keys, like the forward and back keys on some keyboards? I've tried using the KeyEventDemo, but it doesn't record any events. Any ideas?
Thanks.Try this:
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(
new KeyEventDispatcher() {
public boolean dispatchKeyEvent(KeyEvent e) {
System.out.println(e.getKeyCode());
return false;
});It will detect all keyevents and print the correpsonding keycode. If this code does not react when you press those arrow keys, then you cannot detect them using pure java.
Maybe you are looking for
-
How to find out what the geniric short forms stand for?
Hi if you see the ThreadLocal class in jdk1.6 it is written like this in doc. ThreadLocal<T> and if you see the method Class.forName() the return type is Class<?> i am just confused a littele bit. how to find out what this <T> and <?> stands for? I m
-
Dear All, We have inventory settings as follows: 1. Group Fruit 2. Name Pineaple 3. Code P001 4.Grade value : 24 -> Grade A, Grade B, Grade C 5. Price List Grade A, Grade B, Grade C I am really confusing whether I have to create itemcode P00124A or j
-
Hello, I have quite a full calendar with different names and work schedules on it. Suddenly one day, after printing, my iCal began to add an extra calendar that appears twice in one day. So that I already have mine, "Deanna 12-Close", then it will ad
-
File is too large for attachment - BO Integration Error
I developed Crystal reports (using Universe)in CR XIR2 and deployed in BO XIR 2 Repository. Reports database is -DB2. I am able to preview the reports in CMC/Infoview. But when we are integrating our Application(Called GBS) to BO ,and when I am tryin
-
I see there is another ios update. I have an iPhone 4S. The last time I updated the ios I lost all my contacts, as I had not been using the iCloud as a backup. I am now apprehensive about the latest update. How can I determine if contacts are backed