Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Referential Integrity Using View
Mahesh, MS, PMP wrote:
> In ORACLE 10g is there a way to use a view as the target of a foreign
> key definition?
>
> Let me explain the situation. We use the ATG framework (ATG commerce
> framework) which uses repository files (ORM) to access the data
> repository. It has an internal structure for accessing products. We
> have our own product database which we can access by overriding the
> default XML repository file to point to our tables instead of ATG
> product tables.
>
> The problem is that when we want to use the commerce framework and use
> persistent shopping cart there are foreign keys to the ATG product
> tables and since they are empty it causes foreign key violation.
>
> Specifically table dcspp_item (holds shopping cart item) has a
> reference to dcs_product (ATG's product table) and is there a way we
> can create a view that has it instead refer to our own product table?
> So is there anything we can do short of populating the keys and/or
> disabling the constraints?
>
> Thanks in advance.
You can do it with an INSTEAD-OF triggers.
Demos in Morgan's Library at www.psoug.org.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sat Jul 22 2006 - 14:04:20 CDT