added scrape routines for the TEST_WAFER_PROD (i.e., PRODUCT) table

This commit is contained in:
Infineon\StieberD
2025-09-10 12:21:49 -07:00
parent 557221c0d3
commit 30372169ba
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,37 @@
Compile function Copy_Test_Wafer_Prod_Record_To_SQL(Connection, Key, Record)
/*****************************************************************************\
Copies the given TEST_WAFER_PROD (to be renamed) PRODUCT record to the MSSQL database.
History
-------
09/10/2025 DJS Original Programmer
\*****************************************************************************/
$insert TEST_WAFER_PROD_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 = "PRODUCT_ID":@VM:SQL_Format(Key, "STR")
// List of data fields and their values
DataFields = "PART_NAME" :@VM:SQL_Format(Rec(TEST_WAFER_PROD_PART_NAME$), "STR"):@FM
DataFields := "USAGE" :@VM:SQL_Format(Rec(TEST_WAFER_PROD_USAGE$), "INT"):@FM
DataFields := "SORT_ORDER" :@VM:SQL_Format(Rec(TEST_WAFER_PROD_SORT_ORDER$), "INT")
// Symbolics
// Write the data to the SQL database
Ans = SQL_Write(Connection, "PRODUCT", Keys, DataFields);
//-------------------------------------------------------------------------------------------------
// Multi-valued Fields
Return Ans

View File

@ -0,0 +1,30 @@
Compile function Delete_Test_Wafer_Prod_Record_From_SQL(Connection, Key, Record)
/*****************************************************************************\
Deletes the given TEST_WAFER_PROD (to be renamed PRODUCT) record from the MSSQL database.
History
-------
09/10/2025 DJS Original Programmer
\*****************************************************************************/
Declare function SQL_Delete, SQL_Format
Ans = ""
// List of key names and their values
Keys = "PRODUCT_ID":@VM:SQL_Format(Key, "STR")
//-------------------------------------------------------------------------------------------------
// Multi-valued Fields
!! Delete records from MV tables first !!
// Currently no multi-value (child) tables
// OPERATION
If Ans EQ "" then
Ans = SQL_Delete(Connection, "PRODUCT", Keys)
end
Return Ans