--UPDATE FROM 8.13.4.1 TO 8.13.5.0

create or replace TRIGGER wlckTablename before insert on wlck for each row 
begin  
   case
   when :new.wlck_type=0 then :new.wlck_tableName:='YRES';  --ltReservation  
   when :new.wlck_type=1 then :new.wlck_tableName:='XCMS';  --ltProfile      
   when :new.wlck_type=2 then :new.wlck_tableName:='ZINV';  --ltInvoice      
   when :new.wlck_type=3 then :new.wlck_tableName:='RESB';  --ltResBilling   
   when :new.wlck_type=4 then :new.wlck_tableName:='FABI';  --ltFABilling    
   when :new.wlck_type=5 then :new.wlck_tableName:='WLUG';  --ltLuggageLabel 
   when :new.wlck_type=6 then :new.wlck_tableName:='YBOM';  --ltBookingMaster
   when :new.wlck_type=7 then :new.wlck_tableName:='YEVM';  --ltBookingEvent 
   when :new.wlck_type=8 then :new.wlck_tableName:='';      --ltBookingFS
   when :new.wlck_type=9 then :new.wlck_tableName:='';      --ltBookingCI
   when :new.wlck_type=10 then :new.wlck_tableName:='';     --ltBookingMN
   when :new.wlck_type=11 then :new.wlck_tableName:='RRES'; --ltTableReservationRes
   when :new.wlck_type=12 then :new.wlck_tableName:='YBLH'; --ltBlock            
   when :new.wlck_type=13 then :new.wlck_tableName:='WACT'; --ltActivity         
   when :new.wlck_type=14 then :new.wlck_tableName:='WACT'; --ltTask             
   when :new.wlck_type=15 then :new.wlck_tableName:='FIDS'; --ltFidServerService 
   when :new.wlck_type=16 then :new.wlck_tableName:='COUP'; --ltCertificate      
   when :new.wlck_type=17 then :new.wlck_tableName:='ZINN'; --ltNumberCycle      
   when :new.wlck_type=18 then :new.wlck_tableName:='YGRP'; --ltGroup            
   when :new.wlck_type=19 then :new.wlck_tableName:='YBIS'; --ltBillInst         
   when :new.wlck_type=20 then :new.wlck_tableName:='';     --ltCertificateOrder 
   when :new.wlck_type=21 then :new.wlck_tableName:='XMRN'; --ltMembershipNumber 
   when :new.wlck_type=22 then :new.wlck_tableName:=''; --ltNumberCycleType
   when :new.wlck_type=23 then :new.wlck_tablename:='WJET';--ltEventJournal
   when :new.wlck_type=24 then :new.wlck_tableName:='SITT'; --ltTransactionTotalsSignature
   when :new.wlck_type=25 then :new.wlck_tableName:='ZIFS'; --ltInvoiceSignature
   when :new.wlck_type=26 then :new.wlck_tableName:='XCAP'; --ltCreditCardApproval
   when :new.wlck_type=27 then :new.wlck_tableName:='WPRT'; --ltProtectedDataAccess
   end case;
end;
/