Compile function Copy_ASSIGN_CAUSE_Record_To_SQL(Connection, Key, Record)

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

Declare function SQL_Write, SQL_Format
Ans = ""

// Parse record into a dimensioned array for speed
Dim Rec(6)
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  = "DESIG_ERR_GRP"    :@VM:SQL_Format(Rec(1), "INT"):@FM
DataFields := "ASSIGN_CAUSE_DESC":@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 := "STATUS"           :@VM:SQL_Format(Rec(5), "STR")

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

Return Ans
