Overview
This page documents miscellaneous triggers that do not fit neatly into vessel, ownership, cargo, structural, casualty, codebook, or supplemental categories. It covers:
- 1ABSD_NCON — New-construction order register. The most complex trigger in the system: multi-table cascade, OWNC rebuild, EDM country validation (March 2026), and 6 satellite cascades.
- 2ABSD_NCON_CONFI — Confidential attributes for new-construction orders (shiptype, dimensions, FLAG). Additional FK checks and dimensional cross-checks.
- 3ABSD_SALE — Sale and scrap transaction records. Writes tblFSWSalesPage, enriched tblChanges audit via
fnSalesDetail(), and J06 audit on effective-date change. - 4tblChanges — Self-trigger on the primary audit log table. Automatically zero-pads CompanyNo to 7 digits on every insert.
- 5tblAnnotationLogGeneral — Self-trigger on the annotation log. Automatically populates Source field from the current user's settings on every insert.
- 6QH_ShipsOwner_Data — Questionnaire response system. One business trigger (updates QH_Questionnaires.LastResponseDate) plus three SQL Server merge-replication infrastructure triggers.
- 7ofac_sdn2 — OFAC Specially Designated Nationals list. Inserts and deletes write a tblChanges audit record (ChangeType='OFAC').
- 8PANDI — P&I Club table. No trigger files are present in the Triggers directory; enforcement for this domain is handled elsewhere.
ABSD_NCON — New Construction Register
The most complex trigger in the system. Validates new-construction order fields, enforces date rules, cascades to six satellite tables, rebuilds the entire ABSD_OWNC set from scratch, updates SHIP_SEARCH, and writes annotation and staging.
Guard & Cursor
- 1Standard
TRIGGER_DISABLEguard at the top. Cursor iterates overinsertedbyLRNO.
Country Code Validation — EDM March 2026
COB (Country of Build) and PCOB (Previous Country of Build) were migrated from ABSD_CBCY to EDM.dbo.T_REF_COUNTRY with collation Latin1_General_CI_AI. This change was applied in March 2026. Any new country-validation code should target the EDM table, not the local codebook.- 2
COBmust exist inEDM.dbo.T_REF_COUNTRY(collateLatin1_General_CI_AI). - 3
PCOB(Previous Country of Build) must also exist inEDM.dbo.T_REF_COUNTRYwhen populated.
Status / Indicator Field Validation
- 4
PIND(Program Indicator) must be one of:N,P,Y,C. - 5
RIND(Request Indicator) must beYor NULL. - 6
SPSIND(Special Survey Indicator) must beYor NULL. - 7
COMI(Commercially Ordered flag) validated as Y/N viavalStandardYN. - 8
RET1(Retention flag) validated as Y/N viavalStandardYN.
Date Validation
- 9
DATE_NCON(Order Date): validated viavalStandard4_new. Additionally, must not be in the future — enforced by comparingfnrealdatetolrdate(getdate())against the field value. This is one of the few "future date" blocks in the system. - 10
CDTE(Keel-laying date),PDTE(Planned delivery),KEST(Estimated keel),LEST(Estimated launch) — all validated viavalStandard4_new.
Cascade to Satellite Tables
RIND to REQIND field.GNTE (General Notes) is split at 36 characters into GENNOTES (first 36) and GENNOTES2 (remaining 24), preserving the 36+24 mainframe character layout.COMMQTR, LNCHQTR, and COMPQTR (quarter codes from dates).PRPOS (Prefab Portion) and PRCOB (Prefab Country).OWNC Rebuild — Critical Business Rule
ABSD_OWNC records for the vessel (SHLRNO) and rebuilds them from scratch. The rebuild logic:
- Insert from
ABSD_HIMAwhere role =MR(Manager) - Insert from
ABSD_HIOWwhere role =RC(Registered Company) - Exclude company code
9991001from both sources
SHIP_SEARCH Update
- 11Writes
DATE_NCONtoABSD_SHIP_SEARCHto keep the search index current.
Annotation & Staging
- 12Writes annotation record for field
C11I(order-date field) grouping. - 13Inserts into
ABSD_NCON_UPDATESstaging table for downstream ETL processing.
ABSD_NCON_CONFI — Confidential New Construction
Validates confidential new-construction attributes including ship type, hull shape, classification, full vessel dimensions, flag country, and contact details. Writes a tblChanges audit record for Shipname and Shipmanager changes.
Country / Flag Validation — EDM March 2026
FLAG, PCOB, and COB all validated against EDM.dbo.T_REF_COUNTRY rather than the local ABSD_CBCY codebook.Codebook FK Checks
- 1
STAT5CODEmust exist intblMasterShipTypeXref. - 2
HULL_SHAPEmust exist inABSD_CBUB1whereFLDI='11'(hull shape codebook). - 3
CLASSmust exist inABSD_CBUB1whereFLDI='62'(classification society codebook). - 4
SHIPTYPEmust exist intblMasterShipTypeXref.inbassub.
Dimension Validation
SHIPTYPE starting with '7' (offshore/non-conventional hulls) are exempt from the LBP>Breadth and LOA>Draught cross-checks. The rationale is that semi-submersibles and similar unusual forms have depth or beam configurations that violate conventional hull geometry rules.- 5
GROSSandDWT— maximum 7 digits. - 6
LBP ≤ LOA— Length Between Perpendiculars must not exceed Length Overall. - 7
LBP > Breadth— LBP must be greater than beam (exempted for shiptype starting with '7'). - 8
LOA > Breadth— LOA must be greater than beam. - 9
LOA > Maxdraught— LOA must exceed maximum draught. - 10
LBP > Maxdraught— LBP must exceed maximum draught.
Date Validation
- 11
DATE_NCON,CDTE,KEST,LEST— all validated viavalStandard4.
tblChanges Audit
- 12Writes to
tblChangeswhenShipnamechanges — old and new values recorded. - 13Writes to
tblChangeswhenShipmanagerchanges — old and new values recorded. - 14Uses standard historical awareness: when the record is not current (SEQ ≠ '00'), the ChangeType is prefixed to indicate a historical amendment.
| Field | Validation | Source |
|---|---|---|
FLAG | FK exists | EDM.dbo.T_REF_COUNTRY (Mar 2026) |
PCOB | FK exists | EDM.dbo.T_REF_COUNTRY (Mar 2026) |
COB | FK exists | EDM.dbo.T_REF_COUNTRY (Mar 2026) |
STAT5CODE | FK exists | tblMasterShipTypeXref |
HULL_SHAPE | FK exists | ABSD_CBUB1 FLDI='11' |
CLASS | FK exists | ABSD_CBUB1 FLDI='62' |
SHIPTYPE | FK in inbassub | tblMasterShipTypeXref |
GROSS, DWT | max 7 digits | — |
| LBP ≤ LOA | cross-check | — |
| LBP > Breadth | cross-check (exemption: shiptype '7*') | — |
| LOA > Breadth | cross-check | — |
| LOA > Maxdraught | cross-check | — |
| LBP > Maxdraught | cross-check | — |
DATE_NCON, CDTE, KEST, LEST | valStandard4 | — |
ABSD_SALE — Sale and Scrap Records
Manages the full lifecycle of sale and scrap transaction records. Writes to the vessel sales page (tblFSWSalesPage) when the effective date changes, produces enriched audit entries in tblChanges via fnSalesDetail(), and applies historical-awareness logic based on sequence number.
Guard & Cursor
- 1Standard
TRIGGER_DISABLEguard. Cursor iterates overinsertedbyLRNO + SEQ_NO.
Sales Page Integration (SEQ='00' only)
- 2When
SALE_EFD(Sale Effective Date) changes AND the record is current (SEQ_NO = '00'), updatestblFSWSalesPageto set the sale status to'S'(Sold). - 3Historical records (
SEQ_NO ≠ '00') do not trigger a tblFSWSalesPage update — only the current record drives the sales page status.
tblChanges Audit
- 4Writes to
tblChangeswhenReported_Sold_Tois not empty, OR whenSale_Price_USD > 0. - 5The
Notesfield in tblChanges is populated using the scalar functiondbo.fnSalesDetail(), which formats a rich human-readable summary of the sale (price, currency, buyer, date, etc.). - 6Historical-awareness: When
SEQ_NO ≠ '00', the ChangeType is prefixed with "Made historical" or "Historical amendment" to distinguish historical-record edits from current-record edits.
Annotation
- 7Writes an annotation record for field group
Sale_Efd(sale effective date grouping). - 8J06 audit is written when
SALE_EFDchanges.
Records the deletion of a sale record as an "Erroneous sales report" in tblChanges. Only fires for current-record deletions (SEQ='00').
Business Rules
- 1Standard
TRIGGER_DISABLEguard. Cursor iterates overdeleted. - 2Only processes records where
SEQ = '00'— deletion of historical records does not generate a tblChanges entry. - 3Writes to
tblChanges:OldValue = 'Deleted'NewValue = 'Deleted'Notes = 'Erroneous sales report -' + dbo.fnSalesDetail()
- 4Writes J06 audit record.
fnSalesDetail() for traceability.Audit Infrastructure Self-Triggers
tblChanges and tblAnnotationLogGeneral). They are infrastructure triggers: every other trigger in the system that writes to these tables will automatically trigger these in turn, without needing to know about them. They exist to enforce invariants that would otherwise require every calling trigger to implement individually.Self-trigger on the tblChanges audit table. Automatically normalises CompanyNo to 7-digit zero-padded format on every insert, so that audit consumers always see a uniform company number format regardless of how the calling trigger formatted it.
Business Rules
- 1Standard
TRIGGER_DISABLEguard. Cursor iterates over inserted rows. - 2CompanyNo normalisation: If
LEN(CompanyNo) < 7, pad with leading zeros to exactly 7 digits. Example:'1234'→'0001234'. - 3If
CompanyNois already 7 or more digits, no change is made. - 4This runs on every insert into tblChanges — including inserts made by OW* company triggers, SALE triggers, OFAC triggers, and any other system that writes to tblChanges.
Self-trigger on the tblAnnotationLogGeneral annotation table. Automatically populates the Source field on every new annotation entry by looking up the current user's source setting from tblUserSettings. This means callers never need to supply Source — it is always resolved at insert time from the user context.
Business Rules
- 1No
TRIGGER_DISABLEguard. The trigger fires unconditionally on every insert intotblAnnotationLogGeneral. - 2On each new annotation row: looks up
tblUserSettings.currentsourceWHEREusername = SYSTEM_USER. - 3Sets the
Sourcefield of the newly inserted annotation row to the retrievedcurrentsourcevalue. - 4If
SYSTEM_USERhas no row intblUserSettings,Sourceremains as supplied by the caller (or NULL).
| Mechanism | Detail |
|---|---|
| Source lookup | SELECT currentsource FROM tblUserSettings WHERE username = SYSTEM_USER |
| Applied to | Every INSERT into tblAnnotationLogGeneral |
| Effect | Callers do not need to set Source — it is always resolved from session context |
| Guard | None — fires even in bulk-load mode |
QH_ShipsOwner_Data — Questionnaire System
del_A3FCC..., ins_A3FCC..., upd_A3FCC...) and contain no business logic — they maintain the merge replication change-tracking tables (ctsv_... and tsvw_...). They all exit immediately when sessionproperty('replication_agent') = 1 and trigger_nestlevel() = 1, preventing infinite replication loops. These are not documented in detail as they are system-managed.Business trigger for the ship-owner questionnaire system. When a questionnaire response record is actioned, updates the parent questionnaire's LastResponseDate to the current datetime.
Business Rules
- 1Fires on INSERT, UPDATE, and DELETE — but reads the
ActionTypefrom theInsertedtable. - 2Only executes the business logic when
ActionType = 'R'(Response). Other action types are silently ignored. - 3When
ActionType = 'R': updatesQH_Questionnaires.LastResponseDate = GetDate()for the matchingQH_Questionnaires.ID = Inserted.QuestID. - 4No TRIGGER_DISABLE guard — fires regardless of bulk-load mode.
ActionType = 'R' check reads from Inserted which is empty on a DELETE — so the LastResponseDate update cannot fire on deletes. The FOR DELETE is present to make the trigger fire on all operations, likely for future extensibility.| Trigger | Type | Purpose |
|---|---|---|
QH_shipsOwner_Data_UpdateTrigger | Business | ActionType='R' → update QH_Questionnaires.LastResponseDate |
del_A3FCCDB257C64C08AB9FEA7D543EDF32 | Replication | Merge replication DELETE tracking (system-managed) |
ins_A3FCCDB257C64C08AB9FEA7D543EDF32 | Replication | Merge replication INSERT tracking (system-managed) |
upd_A3FCCDB257C64C08AB9FEA7D543EDF32 | Replication | Merge replication UPDATE tracking, prevents rowguid updates |
SQL Server merge-replication change-tracking triggers (system-generated). These maintain ctsv_/tsvw_ tracking tables and must not be modified manually.
- 1All three triggers exit immediately if
sessionproperty('replication_agent') = 1 AND trigger_nestlevel() = 1— prevents replication loops. - 2del_*: On delete, records rowguid + type=1 ('delete') into
tsvw_A3FCC...with UPDATELINEAGE tracking. Removes the row fromctsv_A3FCC.... - 3ins_*: On insert, tracks the new row in
ctsv_A3FCC...with lineage and column-vector (colv1). Handles 41 columns (@ccols = 41). Special logic for re-insert of a previously deleted rowguid (increments version counter). - 4upd_*: On update, updates lineage and
colv1bit-map inctsv_A3FCC...viaUPDATECOLVBM. Preventsrowguidcolumn updates (RAISERROR 20062 and rollback). - 5All three use
tablenick = 8648000to identify the article insysmergearticles. - 6All use
ANSI_NULLS OFF(note the SET at the top) — this is the standard SQL Server replication trigger pattern.
ofac_sdn2 — OFAC Sanctions List
ofac_sdn2 table contains the OFAC Specially Designated Nationals (SDN) list maintained by the US Treasury. The triggers on this table write a tblChanges audit record every time a vessel is added to or removed from the SDN list. The IMO field maps to LRNo in tblChanges, and the identifier field carries the SDN designation code.Records the addition of a vessel to the OFAC SDN sanctions list in tblChanges. No business validation — pure audit trail.
- 1No
TRIGGER_DISABLEguard — fires unconditionally on every insert. - 2Inserts one row per inserted row into
tblChanges:LRNo = i.IMO(maps OFAC IMO number to vessel LRNO)CompanyNo = NULLEffDate = CAST(getdate() AS varchar)ChangeType = 'OFAC'Source = 'OFAC'OldValue = NULLNewValue = i.identifier(the SDN designation added)Confidential = 0
Records the removal of a vessel from the OFAC SDN sanctions list in tblChanges. No business validation — pure audit trail.
- 1No
TRIGGER_DISABLEguard — fires unconditionally on every delete. - 2Inserts one row per deleted row into
tblChanges:LRNo = d.IMOCompanyNo = NULLEffDate = CAST(getdate() AS varchar)ChangeType = 'OFAC'Source = 'OFAC'OldValue = d.identifier(the SDN designation removed)NewValue = NULLConfidential = 0
CompanyNo = NULL, the zero-padding rule is a no-op.| Trigger | Event | OldValue | NewValue | ChangeType |
|---|---|---|---|---|
OFAC_INSERT | Vessel added to SDN list | NULL | identifier | 'OFAC' |
OFAC_DELETE | Vessel removed from SDN list | identifier | NULL | 'OFAC' |
PANDI — P&I Club
Triggers/ directory for dbo.ABSD_PAND*.sql and related patterns returned no results. The PANDI (Protection & Indemnity Club) table does not have any trigger files scripted out in this deployment. P&I club changes may be enforced at the application layer, handled by a stored procedure, or this table may be populated via a feed with no trigger-based rules. If trigger files exist on the live server but were not scripted, they should be scripted and added to this documentation.Complete Trigger Reference
| Table | Trigger | Operation | Guard | Key Output |
|---|---|---|---|---|
ABSD_NCON | ABSD_NCON_Update | UPDATE | TRIGGER_DISABLE | EDM COB/PCOB validation; 6 satellite cascades; OWNC rebuild; SHIP_SEARCH; annotation C11I; NCON_UPDATES staging |
ABSD_NCON_CONFI | ABSD_NCON_CONFI_Update | UPDATE | TRIGGER_DISABLE | EDM FLAG validation; STAT5/HULL/CLASS/SHIPTYPE FK; dimensional cross-checks; tblChanges Shipname/Shipmanager |
ABSD_SALE | absd_sale_update | UPDATE | TRIGGER_DISABLE | SALE_EFD → tblFSWSalesPage status='S'; tblChanges via fnSalesDetail(); annotation Sale_Efd; J06 |
ABSD_SALE | ABSD_SALE_DELETE | DELETE | TRIGGER_DISABLE | SEQ='00' → tblChanges 'Erroneous sales report -' + fnSalesDetail(); J06 |
tblChanges | tblChanges_Insert | INSERT | TRIGGER_DISABLE | Zero-pad CompanyNo to 7 digits if len<7 |
tblAnnotationLogGeneral | tblAnnotationLogGeneral_Insert | INSERT | None | Auto-populate Source from tblUserSettings.currentsource for SYSTEM_USER |
QH_ShipsOwner_Data | QH_shipsOwner_Data_UpdateTrigger | INSERT/UPDATE/DELETE | None | ActionType='R' → QH_Questionnaires.LastResponseDate = GetDate() |
QH_ShipsOwner_Data | del_A3FCC... | DELETE | Repl. agent check | Merge replication change-tracking (system-managed) |
QH_ShipsOwner_Data | ins_A3FCC... | INSERT | Repl. agent check | Merge replication change-tracking (system-managed) |
QH_ShipsOwner_Data | upd_A3FCC... | UPDATE | Repl. agent check | Merge replication change-tracking; blocks rowguid updates |
ofac_sdn2 | OFAC_INSERT | INSERT | None | tblChanges ChangeType='OFAC', NewValue=identifier |
ofac_sdn2 | OFAC_DELETE | DELETE | None | tblChanges ChangeType='OFAC', OldValue=identifier |
PANDI | — | — | — | No trigger files found |
Design Patterns in This Page
| Pattern | Where Used | Purpose |
|---|---|---|
| Future-date block | ABSD_NCON DATE_NCON | Orders cannot be dated in the future; uses fnrealdatetolrdate(getdate()) for comparison |
| Full-rebuild delete+insert | ABSD_NCON → ABSD_OWNC | Every NCON update rebuilds all OWNC records from scratch; OWNC is a derived snapshot, not independently maintained |
| GNTE split at 36/24 | ABSD_NCON → ABSD_FREEFORM | Mainframe 60-char field split into two ABSD columns to preserve fixed-width layout |
| Enriched audit via function | ABSD_SALE → tblChanges | fnSalesDetail() formats a human-readable sale summary; no other trigger uses this pattern |
| Self-trigger normalisation | tblChanges_Insert | Infrastructure trigger corrects CompanyNo format centrally, relieving callers of this responsibility |
| Self-trigger source resolution | tblAnnotationLogGeneral_Insert | Source populated from session context, not from the calling trigger |
| ActionType field dispatch | QH_shipsOwner_Data_UpdateTrigger | Single FOR INSERT/UPDATE/DELETE trigger dispatches on ActionType value rather than having multiple triggers |
| OFAC add/remove audit | OFAC_INSERT / OFAC_DELETE | OldValue/NewValue=NULL pattern: INSERT sets NewValue, DELETE sets OldValue |
| EDM country migration | NCON, NCON_CONFI | March 2026 migration of FLAG/COB/PCOB from ABSD_CBCY to EDM.dbo.T_REF_COUNTRY |