Compile function Delete_EPI_PART_Record_From_SQL(Connection, Key, Record)

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

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

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

!! Delete records from MV tables first !!

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

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

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

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

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

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

Return Ans
