
B-75074EN/04 USER CUSTOMIZE 4.REFERENCING THE DATABASE
- 457 -
For counting the total number of PlanNum's, the Sum function is used.
In the Where clause, iSQLWhere passed as an argument is also used.
DB_McnCnd module
The DB_McnCnd module defines procedures for acquiring progress
status data from the
i CELL database.
GetMcnCndData :: DB_McnCnd
This procedure acquires progress status data. Data is created in the
progress status display table, and data is acquired from the progress
status display table.
Data is acquired in a dynamic array of the structure (typMcnCnd).
The SQL statement is created as follows:
tSQL = "SELECT w.McnID, wm.McnName, w.WorkID,
ww.WorkName, w.ONum," & _
" w.FirstClock, w.LastClockPlan, w.NormNum,
w.PlanNum, w.AllLastClockPlan" & _
" FROM WKPCMcnName wm RIGHT OUTER JOIN" & _
" (WKPCWorkName ww RIGHT OUTER JOIN
WKPCDspMcnCnd w" & _
" ON ww.WorkID=w.WorkID)" & _
" ON wm.McnID=w.McnID" & _
" ORDER BY w.McnID"
By using RIGHT OUTER JOIN ...ON, this SQL statement connects
tables.
1. Connects the workpiece ID setting table with the progress
status 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 McnID of the progress status display table.
DeleteDspMcnCnd :: DB_McnCnd
This procedure clears the data of the progress status display table.
The following SQL statement is created:
tSQL = "DELETE *" & _
" FROM WKPCDspMcnCnd"
From the progress status display table, this SQL statement deletes all
data by using the DELETE command.
CreateMcnCndData :: DB_McnCnd
This procedure creates data for display in the progress status display
table.
The latest log information is acquired for each machine. If there is data
representing current machining, data is created in the progress status
display table by acquiring each data item and calling the write
procedure.