Compile function Delete_CLEAN_INSP_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given CLEAN_INSP 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 = "CI_NO":@VM:SQL_Format(Key, "INT")

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

!! Delete records from MV tables first !!

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

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

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

! This child table doesn't exist in SQL anymore...
// CLEAN_INSP_CLEAN_VER_SIG
* If Ans EQ "" then
*    Ans = SQL_Delete(Connection, "CLEAN_INSP_CLEAN_VER_SIG", Keys)
* end

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

! This child table doesn't exist in SQL anymore...
* // CLEAN_INSP_SCAN_VER_SIG
* If Ans EQ "" then
*    Ans = SQL_Delete(Connection, "CLEAN_INSP_SCAN_VER_SIG", Keys)
* end

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

Return Ans
