Compile function Delete_REACT_EVENT_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given REACT_EVENT record from the MSSQL database.
	
	History
	-------
	05/24/2012    KRF   Original Programmer
\*****************************************************************************/

Declare function SQL_Delete, SQL_Format
Ans = ""
				    
// List of key names and their values
Keys  = "REACT_NO" :@VM:SQL_Format(Field(Key, "*", 1), "INT"):@FM
Keys := "EVENT_DTM":@VM:SQL_Format(Field(Key, "*", 2), "DATETIME")

//-------------------------------------------------------------------------------------------------
// Multi-valued Fields

!! Delete records from MV tables first !!

// REACT_EVENT_REACT_UTIL_KEY
If Ans EQ "" then
    Ans = SQL_Delete(Connection, "REACT_EVENT_REACT_UTIL_KEY", Keys)
end

// REACT_EVENT_REACT_LOG_PD_KEY
If Ans EQ "" then
    Ans = SQL_Delete(Connection, "REACT_EVENT_REACT_LOG_PD_KEY", Keys)
end

// REACT_EVENT_REACT_LOG_KEY
If Ans EQ "" then
    Ans = SQL_Delete(Connection, "REACT_EVENT_REACT_LOG_KEY", Keys)
end

// REACT_EVENT
If Ans EQ "" then
    Ans = SQL_Delete(Connection, "REACT_EVENT", Keys)
end

Return Ans
