open-insight/LSL2/STPROC/COPY_WAREHOUSE_RECORD_TO_SQL.txt
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

36 lines
1.2 KiB
Plaintext

Compile function Copy_WAREHOUSE_Record_To_SQL(Connection, Key, Record)
/*****************************************************************************\
Copies the given WAREHOUSE record to the MSSQL database.
History
-------
06/29/2010 KRF Original Programmer
04/21/2012 KRF Dropped per David's Request, SQL_MFS Removed so this
won't be called
\*****************************************************************************/
$insert WAREHOUSE_EQUATES
Declare function SQL_Write, SQL_Write_MV, SQL_Format
Ans = ""
// Parse record into a dimensioned array for speed
Dim Rec(5)
MatParse Record into Rec
// List of key names and their values
Keys = "WH_CD":@VM:SQL_Format(Key, "STR")
// List of data fields and their values
DataFields = "[DESC]" :@VM:SQL_Format(Rec(1), "STR"):@FM
DataFields := "RESP_USER":@VM:SQL_Format(Rec(2), "STR"):@FM
DataFields := "COMP_LOC" :@VM:SQL_Format(Rec(3), "STR")
// Write the data to the SQL database
Ans = SQL_Write(Connection, "WAREHOUSE", Keys, DataFields)
//-------------------------------------------------------------------------------------------------
Return Ans