Compile function Copy_HOTH2O2_LOG_Record_To_SQL(Connection, Key, Record)

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

Declare function SQL_Write, SQL_Format
Ans = ""

// Parse record into a dimensioned array for speed
Dim Rec(8)
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  = "ENTRY_ID"    :@VM:SQL_Format(Rec(1), "STR"):@FM
DataFields := "ENTRY_DATE"  :@VM:SQL_Format(Rec(2), "DATE"):@FM
DataFields := "DATE_CHANGED":@VM:SQL_Format(Rec(3), "DATE"):@FM
DataFields := "TIME_CHANGED":@VM:SQL_Format(Rec(4), "TIME"):@FM
DataFields := "H2O2_AMOUNT" :@VM:SQL_Format(Rec(5), "DEC", "1"):@FM
DataFields := "WATER_AMOUNT":@VM:SQL_Format(Rec(6), "DEC", "1"):@FM
DataFields := "TECH_SIG"    :@VM:SQL_Format(Rec(7), "STR")

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

Return Ans
