Compile function Copy_ORDER_CHANGE_Record_To_SQL(Connection, Key, Record)

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

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

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

// List of data fields and their values
DataFields  = "REASON"    :@VM:SQL_Format(Rec(7),  "STR"):@FM
DataFields := "TIMESTAMP" :@VM:SQL_Format(Rec(8),  "DATETIME"):@FM
DataFields := "USER_NAME" :@VM:SQL_Format(Rec(9),  "STR"):@FM
DataFields := "STATION_ID":@VM:SQL_Format(Rec(10), "STR"):@FM
DataFields := "ORDER_NO"  :@VM:SQL_Format(Rec(11), "INT")

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

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

// SKELETON CODE
If Ans EQ "" AND Rec(1) NE "" then
    
    // List of data fields and their values
    MvFields  = "[TABLE]":@FM:SQL_Format(Rec(1), "STR"):@RM
    MvFields  := "RECORD_KEY":@FM:SQL_Format(Rec(2), "STR"):@RM
    MvFields  := "[COLUMN]":@FM:SQL_Format(Rec(3), "STR"):@RM
    MvFields  := "VALUE":@FM:SQL_Format(Rec(4), "STR"):@RM
    MvFields  := "OLD_VALUE":@FM:SQL_Format(Rec(5), "STR"):@RM
    MvFields  := "NEW_VALUE":@FM:SQL_Format(Rec(6), "STR")
    
    // Write the data to the SQL database
    Ans = SQL_Write_MV(Connection, "ORDER_CHANGE_LOGS", Keys, MvFields);
    
end

Return Ans
