VERIFIED SOLUTION i

Resolve 'ORA-01400: cannot insert NULL into ("PD_OWNER"."DLG_PARTICIPANT"."DP_ID")' in Portrait Dialogue

Issue

Execution of an operation fails with error 'ORA-01400: cannot insert NULL into ("PD_OWNER"."DLG_PARTICIPANT"."DP_ID")'.
Following entry is recorded in Dialog Server Error logs.
-------------------------------------------------------------------------------------------------------------------------------------------
Exception: ORA-01400: cannot insert NULL into ("PD_OWNER"."DLG_PARTICIPANT"."DP_ID")
Time: 11/16/2017 12:13:25 AM
Module: C:\PROGRA~2\PST\MILLIO~1\DIALOG~1\MHDIAL~2.DLL
Version: 6.0.1.311
File date: 10/9/2017 9:09:46 AM
ProcessID: 3588
ThreadID: 5736
Memory usage: 121.54 MiB
Exception type: EOleException
Unit: Data.Win.ADODB.pas
Procedure: Data.Win.ADODB.TADOCommand.Execute
Line: 3380
-------------------------------------------------------------------------------------------------------------------------------------------

Cause

This could happen due to the absence of a trigger 'UNIQUE_DLG_PARTICIPANT' which is responsible for assigning a unique DP_ID in 'DLG_PARTICIPANTS' table.
This trigger may be deleted if 'DLG_PARTICIPANTS' table is dropped due to some reason as it is associated with 'DLG_PARTICIPANTS'.

Resolution

UPDATED: December 18, 2017
Following are the steps that can help in resolving the issue.
 
1. Navigate to Services Console (Start | RUN | services.msc) and stop all the MH Services.
2. Navigate to Component Services (Start | Administrative Tools | Component Services) and disable the MH Dialog Server application.
3. Execute following script on Portrait System Database. The script will create a trigger 'UNIQUE_DLG_PARTICIPANT' on the DLG_PARTICIPANT table.
------------------------------------------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE TRIGGER UNIQUE_DLG_PARTICIPANT BEFORE INSERT ON DLG_PARTICIPANT
REFERENCING NEW AS N
FOR EACH ROW
WHEN (N.DP_ID IS NULL)
BEGIN
  SELECT DLG_PARTICIPANT_SEQ.NEXTVAL INTO :N.DP_ID FROM DUAL;
END;
-------------------------------------------------------------------------------------------------------------------------------------------------
4. Navigate to Component Services (Start | Administrative Tools | Component Services) and enable the MH Dialog Server application.
5. Navigate to Services Console (Start | RUN | services.msc) and start all the MH Services.
 
Note: This definition of trigger is from Portrait Version 6.0. Change in the definition of the trigger is less likely in future version of Portrait Dialogue however it is recommended to confirm the definition of trigger before creating it in later / prior version of Portrait Dialogue. Definition can be confirmed by other installation Portrait
Dialogue having same version / hot fix.