Serji,
Are you trying to implement a trigger to stop duplicate rows from being inserted ? or to handle the error caused an existing constraint ?
If the former, then the (Oracle 8i) syntax for adding a primary key contraint is shown below, if the latter, you may be better putting a trap similar to JohnFill's in the code before your insert, or giving your insert statement an exception handler. Triggers can be a bit funny when it comes to doing selects from the affected table.
[tt]
ALTER TABLE Subject_Transforms
ADD (CONSTRAINT XPKSubject_Transforms
PRIMARY KEY (dimension_name, subject_id))
/[/tt]