Compile function Copy_REACT_SERV_CAT_Record_To_SQL(Connection, Key, Record)

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

$insert REACT_SERV_CAT_EQUATES

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

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

// List of data fields and their values
DataFields  = "REACTOR_SERVICE_CATEGORY":@VM:SQL_Format(Rec(REACT_SERV_CAT_REACTOR_SERVICE_CATEGORY$), "STR"):@FM
DataFields := "ENTRY_ID"                :@VM:SQL_Format(Rec(REACT_SERV_CAT_ENTRY_ID$),                 "STR"):@FM
DataFields := "ENTRY_DATE"              :@VM:SQL_Format(Rec(REACT_SERV_CAT_ENTRY_DATE$),               "STR")

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

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

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

Return Ans
