Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

affected its uniqueness, Check constraint with respect to report-type will be checked after firing this trigger, On firing this trigger column will get uppercase letters, Further check constraint will check the validity of the data as 'BS' or 'PL' against report-type column,

The above wizard option could have achieved through the following script triggers for raak-ledger-master,

How to use before insert trigger

 

create or replace trigger "RAAK-LEDGER-MASTER-BI" BEFORE

insert on "RAAK-LEDGER-MASTER" for each row

begin

 

:NEW,"REPORT-TYPE" := UPPER(:NEW,"REPORT-TYPE");

 

:NEW,"LEDGER-NAME" := UPPER(:NEW,"LEDGER-NAME"); IF :NEW,"RECORD-ID" IS NULL THEN

:NEW,"RECORD-ID" :=

 

TO-NUMBER(SYS-GUID(),'XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXX');

END IF;

 

end;

 

We shall create the same system generated sequence script for raak-trans-master, raak-trans-detail also,

While writing the trigger body, you shall find two new words like NULL,

 

:NEW Null means no data, It is not equivalent to zero, or spaces, Hence comparison cannot be made with null data, But wherever, if you want to