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: PL/SQL: Subqueries in triggers...

Re: PL/SQL: Subqueries in triggers...

From: Peter <depend3_at_yahoo.com>
Date: Fri, 01 Nov 2002 23:27:48 GMT
Message-ID: <U5Ew9.191343$8o4.30413@afrodite.telenet-ops.be>

> CREATE OR REPLACE TRIGGER TGR_CHK_ENT_ID_Type
> BEFORE
> INSERT OR UPDATE OF ENT_KWD_ID_Type
> ON tEntity
> FOR EACH ROW
>
> DECLARE
>
> CURSOR CRS_Keyword IS
> SELECT UPPER(KWD_Section) KWD_Section
> FROM tKeyword
> WHERE KWD_ID = :NEW.ENT_KWD_ID_Type;
>
> REC_Keyword CRS_Keyword%ROWTYPE;
>
> BEGIN
>
> OPEN CRS_Keyword;
> FETCH CRS_Keyword INTO REC_Keyword;
>
> IF REC_Keyword.KWD_Section != 'ENTITYTYPE'
> THEN
> RAISE_APPLICATION_ERROR
> (-20000,'Invalid KWD_ID for ENT_KWD_ID_Type!');
> END IF;
>
> END;
>

I hope you will think about closing a cursor in the futur!!!!!!!! The DBA will not like you otherwise. :) Received on Fri Nov 01 2002 - 17:27:48 CST

Original text of this message

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