Im running a script which would fire a select query and insert the results into a table.
The select query is
select distinct a.child child_id, a.parent parent_id from cat a, par b WHERE a.child=b.catentid and b.catenttype_id='Product' and a.reltype_id='PRODUCT_ITEM'
and inserted into the table which is created as
create table TI_CAT_0 ( child_id NUMBER not null,parent_id NUMBER not null,PRIMARY KEY (child_id))
But I get a unique key constraint violation while running the script as "SYS_C00187123", and I checked this constraint name in all_constraints table and its on the TI_CAT_0 table only.
Since I use the distinct command, I'm not sure why this violation is turning up. Its a Oracle DB.
child_idyou're selecting doesn't already exist inTI_CAT_0table - CodeBirdchild_idwith different values forparent_idand it would still be distinct. - a_horse_with_no_name