Compile function Copy_REACT_ESC_Record_To_SQL(Connection, Key, Record)

/*****************************************************************************\
	Copies the given REACT_ESC record to the MSSQL database.
	
	History
	-------
	08/06/2010    KRF   Original Programmer
	04/21/2012    KRF   Dropped per David's Request, SQL_MFS Removed so this
	                    won't be called
\*****************************************************************************/

$insert REACT_ESC_EQUATES

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

// Parse record into a dimensioned array for speed
Dim Rec(7)
MatParse Record into Rec
					    
// List of key names and their values
Keys  = "REACT_NO" :@VM:SQL_Format(Field(Key, "*", 1), "STR"):@FM
Keys := "START_DTM":@VM:SQL_Format(Field(Key, "*", 2), "DATETIME")

// List of data fields and their values
DataFields  = "START_USER"     :@VM:SQL_Format(Rec(REACT_ESC_START_USER$),      "STR"):@FM
DataFields := "START_REASON"   :@VM:SQL_Format(Rec(REACT_ESC_START_REASON$),    "STR"):@FM
DataFields := "STOP_DTM"       :@VM:SQL_Format(Rec(REACT_ESC_STOP_DTM$),        "DATETIME"):@FM
DataFields := "STOP_USER"      :@VM:SQL_Format(Rec(REACT_ESC_STOP_USER$),       "STR"):@FM
DataFields := "STOP_REASON"    :@VM:SQL_Format(Rec(REACT_ESC_STOP_REASON$),     "STR"):@FM
DataFields := "OUT_OF_PROD_DTM":@VM:SQL_Format(Rec(REACT_ESC_OUT_OF_PROD_DTM$), "DATETIME")

// Write the data to the SQL database
Ans = SQL_Write(Connection, "REACT_ESC", Keys, DataFields)

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

// SKELETON CODE
* If Ans EQ "" AND Rec() NE "" then
*    
*    // List of data fields and their values
*    MvFields  = "":@FM:SQL_Format(Rec(), "INT"):@RM
*    MvFields := "":@FM:SQL_Format(Rec(), "STR"):@RM
*    MvFields := "":@FM:SQL_Format(Rec(), "STR")
*    
*    // Write the data to the SQL database
*    Ans = SQL_Write_MV(Connection, "", Keys, MvFields);
*    
* end

Return Ans
