Compile function Delete_RDS_LAYER_Record_From_SQL(Connection, Key, Record)

/*****************************************************************************\
	Deletes the given RDS_LAYER 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  = "RDS_NO":@VM:SQL_Format(Field(Key, "*", 1), "INT"):@FM
Keys := "LS_ID" :@VM:SQL_Format(Field(Key, "*", 2), "STR")

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

!! Delete records from MV tables first !!

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

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

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

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

Return Ans
