Compile function Delete_SURFACE_SCAN_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given SURFACE_SCAN 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_NO"  :@VM:SQL_Format(Field(Key, "*", 1), "INT"):@FM
Keys := "WO_STEP":@VM:SQL_Format(Field(Key, "*", 2), "INT"):@FM
Keys := "CASS_NO":@VM:SQL_Format(Field(Key, "*", 3), "INT"):@FM
Keys := "STAGE"  :@VM:SQL_Format(Field(Key, "*", 4), "STR")

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

!! Delete records from MV tables first !!

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

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

Return Ans
