Compile function Delete_COC_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given COC record from the MSSQL database.
	
	History
	-------
	09/21/2010    KRF   Original Programmer
\*****************************************************************************/

Declare function SQL_Delete, SQL_Format
Ans = ""
				    
// List of key names and their values
Keys = "WO":@VM:SQL_Format(Key, "INT")

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

!! Delete records from MV tables first !!

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

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

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

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

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

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

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

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

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

Return Ans
