Compile function Copy_REACTOR_MODES_Record_To_SQL(Connection, Key, Record)

/*****************************************************************************\
	Copies the given COC record to the MSSQL database.
	
	History
	-------
	04/14/2010    KRF   Original Programmer
\*****************************************************************************/

$insert REACTOR_MODES_EQUATES

Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""

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

// List of data fields and their values
DataFields  = "E10_STATE"         :@VM:SQL_Format(Rec(REACTOR_MODES_E10_STATE$),          "STR"):@FM
DataFields := "DESCRIPTION"       :@VM:SQL_Format(Rec(REACTOR_MODES_DESCRIPTION$),        "STR"):@FM
DataFields := "SECURITY_LEVEL"       :@VM:SQL_Format(Rec(REACTOR_MODES_SECURITY_LEVEL$),        "STR"):@FM
DataFields := "MODE_CATEGORY"       :@VM:SQL_Format(Rec(REACTOR_MODES_MODE_CATEGORY$),        "STR"):@FM
DataFields := "ICON"       :@VM:SQL_Format(Rec(REACTOR_MODES_ICON$),        "STR"):@FM
DataFields := "NOTIFICATION_ACTIVE"       :@VM:SQL_Format(Rec(REACTOR_MODES_NOTIFICATION_ACTIVE$),        "BOOL"):@FM	
DataFields := "OWNER"       :@VM:SQL_Format(Rec(REACTOR_MODES_OWNER$),        "STR")

// Symbolics


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

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

// Shipping Details
* If Ans EQ "" AND Rec(COC_ORDER_NO$) NE "" then
*    
*    // List of data fields and their values
*    MvFields  = "ORDER_NO"  :@FM:SQL_Format(Rec(COC_ORDER_NO$),   "INT"):@RM
*    MvFields := "ORDER_LINE":@FM:SQL_Format(Rec(COC_ORDER_LINE$), "INT"):@RM
*    MvFields := "RDS_NO"    :@FM:SQL_Format(Rec(COC_RDS_NO$),     "STR"):@RM
*    MvFields := "PART_NUM"  :@FM:SQL_Format(Rec(COC_PART_NUM$),   "STR"):@RM
*    MvFields := "LOT_NUM"   :@FM:SQL_Format(Rec(COC_LOT_NUM$),    "STR"):@RM
*    MvFields := "REACTOR"   :@FM:SQL_Format(Rec(COC_REACTOR$),    "INT"):@RM
*    MvFields := "REJECTS"   :@FM:SQL_Format(Rec(COC_REJECTS$),    "INT"):@RM
*    MvFields := "WAFER_QTY" :@FM:SQL_Format(Rec(COC_WAFER_QTY$),  "INT")
*    
*    // Write the data to the SQL database
*    Ans = SQL_Write_MV(Connection, "COC_SHIPPING_DETAILS", Keys, MvFields);
*    
* end


Return Ans

