
4.REFERENCING THE DATABASE USER CUSTOMIZE B-75074EN/04
- 462 -
DB_LastState module
The DB_LastState module defines procedures for acquiring machining
end state data from the
i CELL database.
GetLastStateData :: DB_LastState
This procedure acquires machining end state data. Data is created in the
machining end state display table, and data is acquired from the
machining end state display table.
Data is acquired in a dynamic array of the structure (typLastState).
The following SQL statement is created:
tSQL = "SELECT w.McnID, wm.McnName, w.WorkID,
ww.WorkName, w.ONum, w.PlanNum, w.ProcNum," & _
" w.LastID0, w.LastID1, w.LastID2, w.LastID3,
w.LastID4, w.LastID5, w.NormNum" & _
" FROM WKPCMcnName wm RIGHT OUTER JOIN" &
_
" (WKPCWorkName ww RIGHT OUTER JOIN
WKPCDspLastState w" & _
" ON ww.WorkID=w.WorkID)" & _
" ON wm.McnID=w.McnID" & _
" ORDER BY w." & m_FieldText
By using RIGHT OUTER JOIN ...ON, this SQL statement connects
tables.
1. Connects the workpiece ID setting table with the machining end
state display table when WorkID matches.
2. Connects the connected tables with the workpieces process
result setting table when McnID matches.
From the connected tables, each data item is acquired in ascending
order of m_FieldText.
DeleteDspLastState :: DB_LastState
This procedure clears the data of the machining end state display table.
The following SQL statement is created:
tSQL = "DELETE *" & _
" FROM WKPCDspLastState"
From the machining end state display table, this SQL statement deletes
all data by using the DELETE command.
CreateLastStateData :: DB_LastState
This procedure creates data for display in the machining end state
display table.
Data is created in the machining end state display table by acquiring
each data item and calling the write procedure.