Compile function Copy_REACT_SERVS_Record_To_SQL(Connection, Key, Record)

/*****************************************************************************\
	Copies the given REACT_SERVS record to the MSSQL database.
	
	History
	-------
	08/09/2010    KRF   Original Programmer
\*****************************************************************************/

$insert REACT_SERVS_EQU

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

// Parse record into a dimensioned array for speed
Dim Rec(14)
MatParse Record into Rec
					    
// List of key names and their values
Keys = "SERV_ID":@VM:SQL_Format(Key, "INT")

// List of data fields and their values
DataFields  = "DESCRIPTION"      :@VM:SQL_Format(Rec(REACT_SERVS_DESCRIPTION$),       "STR"):@FM
DataFields := "ENTRY_ID"         :@VM:SQL_Format(Rec(REACT_SERVS_ENTRY_ID$),          "STR"):@FM
DataFields := "ENTRY_DATE"       :@VM:SQL_Format(Rec(REACT_SERVS_ENTRY_DATE$),        "DATE"):@FM
DataFields := "INJECTOR_CHANGE"  :@VM:SQL_Format(Rec(REACT_SERVS_INJECTOR_CHANGE$),   "BIT"):@FM
DataFields := "PM_DAYS"          :@VM:SQL_Format(Rec(REACT_SERVS_PM_DAYS$),           "INT"):@FM
DataFields := "REACT_SERV_CAT_ID":@VM:SQL_Format(Rec(REACT_SERVS_REACT_SERV_CAT_ID$), "INT"):@FM
DataFields := "GRAPHITE_OR_TUBE" :@VM:SQL_Format(Rec(REACT_SERVS_GRAPHITE_OR_TUBE$),  "STR"):@FM
DataFields := "STATUS"           :@VM:SQL_Format(Rec(REACT_SERVS_STATUS$),            "STR"):@FM
DataFields := "INACTIVE_DATE"    :@VM:SQL_Format(Rec(REACT_SERVS_INACTIVE_DATE$),     "DATE"):@FM
DataFields := "TC_CHANGE_SERVICE":@VM:SQL_Format(Rec(REACT_SERVS_TC_CHANGE_SERVICE$), "BIT"):@FM
DataFields := "REQ_ARM_WAND_DATA":@VM:SQL_Format(Rec(REACT_SERVS_REQ_ARM_WAND_DATA$), "BIT")

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

Return Ans
