added LSL2 stored procedures
This commit is contained in:
28
LSL2/STPROC/COPY_LOCATION_RECORD_TO_SQL.txt
Normal file
28
LSL2/STPROC/COPY_LOCATION_RECORD_TO_SQL.txt
Normal file
@ -0,0 +1,28 @@
|
||||
Compile function Copy_LOCATION_Record_To_SQL(Connection, Key, Record)
|
||||
|
||||
/*****************************************************************************\
|
||||
Copies the given DESIG_ERR_GRP record to the MSSQL database.
|
||||
|
||||
History
|
||||
-------
|
||||
04/22/2010 KRF Original Programmer
|
||||
\*****************************************************************************/
|
||||
|
||||
Declare function SQL_Write, SQL_Format
|
||||
Ans = ""
|
||||
|
||||
// Parse record into a dimensioned array for speed
|
||||
Dim Rec(2)
|
||||
MatParse Record into Rec
|
||||
|
||||
// List of key names and their values
|
||||
Keys = "WH_CD" :@VM:SQL_Format(Field(Key, "*", 1), "STR"):@FM
|
||||
Keys := "LOC_CD":@VM:SQL_Format(Field(Key, "*", 2), "STR")
|
||||
|
||||
// List of data fields and their values
|
||||
DataFields = "DESCRIPTION":@VM:SQL_Format(Rec(1), "STR")
|
||||
|
||||
// Write the data to the SQL database
|
||||
Ans = SQL_Write(Connection, "LOCATION", Keys, DataFields);
|
||||
|
||||
Return Ans
|
Reference in New Issue
Block a user