Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Development Trends in Web and Oracle

Re: Development Trends in Web and Oracle

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Mon, 14 Mar 2005 15:17:27 -0500
Message-ID: <waidnYCdPe7HbKjfRVn-vQ@comcast.com>

"Hexathioorthooxalate" <ruler_at_removemetoemail.clara.co.uk> wrote in message news:1110824826.96483.0_at_dyke.uk.clara.net...
>
> "Galen Boyer" <galenboyer_at_hotpop.com> wrote in message
> news:usm2yg60z.fsf_at_hotpop.com...
>> Hexathioorthooxalate, are you saying that to guarantee parent/child
>> relationships you code triggers?
>
> I haven't written this in the thread so far. But if you really really
> wanted to guarantee parent/child
> relationships in a trigger, you could. I've coded (untested) up an example
> below. It is pretty clumbsy but it does answer the question - you can (but
> probably wouldn't) enforce referential integrity this way.
>
>
> CREATE TRIGGER galenRefTest
> BEFORE INSERT OR UPDATE ON childTable
> FOR EACH ROW
> DECLARE
> RefIntegDataValid NUMBER
> BEGIN
> SELECT COUNT(*)
> INTO RefIntegDataValid
> FROM parentTable
> WHERE parentTable.ID=
>
> EXTRACT(:NEW.xmltypeColumnBeingUpdated,'company/employee/id/text()');
>
> IF RefIntegDataValid=0 THEN
> RAISE_APPLICATION_ERROR(errornumber,'appropriate error message');
> END IF;
>
> END;
>
> Regards
> Hex
>

Yes, you're right... shouldn't do it that way.

Simple have XML DB shred the document into object/relational tables and then use DRI on them.

++ mcs Received on Mon Mar 14 2005 - 14:17:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US