Compile function Delete_WO_LOG_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given WO_LOG 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 !!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Return Ans
