
B-75074EN/04 USER CUSTOMIZE 4.REFERENCING THE DATABASE
- 461 -
DB_Log module
The DB_Log module defines a procedure for acquiring log data from
the
i CELL database.
GetLogData :: DB_Log
This procedure acquires log data.
The following SQL statement is created:
tSQL = "SELECT w.McnID, wm.McnName, w.WorkID,
ww.WorkName, w.ONum," & _
" w.FirstClock, w.LastClock, w.LastID, wl.LastStr,
w.UserID, wu.UserStr, w.SNum" & _
" FROM WKPCMcnName wm RIGHT OUTER JOIN" &
_
" (WKPCWorkName ww RIGHT OUTER JOIN" & _
" (WKPCLastStateConfig wl RIGHT OUTER JOIN" & _
" (WKPCUserConfig wu RIGHT OUTER JOIN
WKPCData w" & _
" ON wu.UserID = w.UserID)" & _
" ON wl.LastID = w.LastID)" & _
" ON ww.WorkID=w.WorkID)" & _
" ON wm.McnID=w.McnID" & _
tSQLWhere & _
" ORDER BY w.FirstClock DESC, w.ID DESC"
By using RIGHT OUTER JOIN ... ON, this SQL statement connects
tables.
1. Connects the user area ID setting table with the workpieces
process result data table when UserID matches.
2. Connects the connected tables with the machining end ID setting
table when LastID matches.
3. Connects the connected tables with the workpiece ID setting
table when WorkID matches.
4. Connects the connected tables with the workpieces process result
setting table when McnID matches.
From the connected tables, each data item is acquired in descending
order of FirstClock and ID of the workpieces process result data table.
A Where clause (tSQLWhere) is created using CreateSQLWhere.