![Free-eBooks.net](/resources/img/logo-nfe.png)
![All New Design](/resources/img/allnew.png)
---------------- --------
bank account BANK ACCOUNT
Here, new word select is found, It is another command word like CREATE, ALTER SELECT means pick records, Select followed by column names and FROM is the must word to decide and should be followed with << table name >> ,
Another business rule needs to be incorporated in the same trigger, At the time of inserting new record, Ledger-code should be generated and
inserted in the Ledger code, Ledger Code length is 10,
Report Code
Ledger-Sequence
Group Code
B
S
-
0
0
0
1
-
0
0
How to use before insert or update trigger CREATE OR REPLACE TRIGGER "RAAK-ledger-MASTER-BI" BEFORE
INSERT OR UPDATE on "RAAK-LEDGER-MASTER" for each row
begin
if :NEW,"RECORD-ID" IS NULL THEN
:NEW,"RECORD-ID" :=
TO-NUMBER(SYS-GUID(),'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
select :NEW,"REPORT-TYPE" II'-'IILPAD(LEDGER-SEQ,NExTVAL,4,'0')II'-00' into :NEW,"LEDGER-CODE" from dual;
END IF;
:NEW."LEDGER_NAME" : UPPER(:NEW."LEDGER_NAME");
:NEW."REPORT_TYPE") : UPPER(:NEW."REPORT_TYPE"); end;