Compile function Copy_REACT_ITEMS_Record_To_SQL(Connection, Key, Record)

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

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

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

// List of data fields and their values
DataFields  = "DESCRIPTION"     :@VM:SQL_Format(Rec(1), "STR"):@FM
DataFields := "STATUS"          :@VM:SQL_Format(Rec(2), "STR"):@FM
DataFields := "ENTRY_ID"        :@VM:SQL_Format(Rec(3), "STR"):@FM
DataFields := "ENTRY_DATE"      :@VM:SQL_Format(Rec(4), "DATE"):@FM
DataFields := "GRAPHITE_OR_TUBE":@VM:SQL_Format(Rec(5), "STR"):@FM
DataFields := "INACTIVE_DATE"   :@VM:SQL_Format(Rec(6), "DATE"):@FM
DataFields := "UNKNOWN1"        :@VM:SQL_Format(Rec(7), "BIT"):@FM
DataFields := "UNKNOWN2"        :@VM:SQL_Format(Rec(8), "BIT")

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

Return Ans
