Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
cli:franke:shared_data [2018/08/27 12:21] f.zoppini [Relationships] |
cli:franke:shared_data [2018/08/27 14:01] (current) f.zoppini [Sample queries] |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ==== Database access: technical information ==== | ==== Database access: technical information ==== | ||
| ^DB Server | 10.100.145.20 (fkt20g.fa.franke.world) | | ^DB Server | 10.100.145.20 (fkt20g.fa.franke.world) | | ||
| - | ^SB Server Port |5432| | + | ^DB Server Port |5432| |
| ^DBMS | Postgresql| | ^DBMS | Postgresql| | ||
| ^ODBC Driver | [[https:// | ^ODBC Driver | [[https:// | ||
| ^Database name|andon_FWK| | ^Database name|andon_FWK| | ||
| - | ^Username|(readonly)| | + | ^Database schema|shareddata| |
| - | ^Password|| | + | ^Username| |
| + | ^Password| | ||
| ==== E-R diagram ==== | ==== E-R diagram ==== | ||
| Line 34: | Line 35: | ||
| | | |oracr|Time of the tracked production unit (HH: | | | |oracr|Time of the tracked production unit (HH: | ||
| ^ ^ ^ ^ ^ ^ ^ | ^ ^ ^ ^ ^ ^ ^ | ||
| - | | **causanc** |**Non compliant causes list**|__codice__|Cause unique identifier|varchar| | + | | **qcausanc** |**Non compliant causes list**|__codice__|Cause unique identifier|varchar| |
| | | |descrizio|Cause description|varchar| | | | | |descrizio|Cause description|varchar| | | ||
| ^ ^ ^ ^ ^ ^ ^ | ^ ^ ^ ^ ^ ^ ^ | ||
| - | | **causafm** |**Downtime causes list**|__codice__|Downtime unique identifier|varchar| | + | | **qcausafm** |**Downtime causes list**|__codice__|Downtime unique identifier|varchar| |
| | | |descrizio|Downtime description of the monitored resource|varchar| | | | | |descrizio|Downtime description of the monitored resource|varchar| | | ||
| | | |tipofm|Downtime type: F = unplanned downtime, M = microstop, P = planned downtime|varchar| | | | | |tipofm|Downtime type: F = unplanned downtime, M = microstop, P = planned downtime|varchar| | | ||
| Line 68: | Line 69: | ||
| |**causanc**(__codice__, | |**causanc**(__codice__, | ||
| |**causafm**(__codice__, | |**causafm**(__codice__, | ||
| - | |**regprod**(__codice__, | + | |**regprod**(__codice__, |
| - | |**regnc**(__codice__, | + | |**regnc**(__codice__, |
| - | |**regfm**(__codice__, | + | |**regfm**(__codice__, |
| + | |||
| + | ==== Sample queries ==== | ||
| + | Produced items on June 18th 2018 with date, time, unique identifier, production resource description, | ||
| + | <code sql> | ||
| + | SELECT DATA, ora, codlot, prodline.descrizio AS linea, prodline.descrep, | ||
| + | INNER JOIN shareddata.prodline ON prodline.codice=shareddata.regprod.codubi | ||
| + | INNER JOIN shareddata.unitprod ON unitprod.codice=shareddata.regprod.codlot | ||
| + | WHERE DATA=' | ||
| + | ORDER BY tm | ||
| + | </ | ||
| + | Count produced items after June 18th 2018 (included) grouped by day, article code and work order on production resource 821102A (DMG LB) | ||
| + | <code sql> | ||
| + | select data, unitprod.dart, | ||
| + | inner join shareddata.unitprod on shareddata.unitprod.codice=shareddata.regprod.codlot | ||
| + | where regprod.codubi=' | ||
| + | group by data, dart, procord | ||
| + | </ | ||
| + | Get the DMG LB (821102A) downtime events list from 06:00 to 14:00 of June 18th 2018 with date, time, duration in minutes, event type, downtime cause description, | ||
| + | <code sql> | ||
| + | select data, ora, tmdiff/60 as dtm, tipoevento, qcausafm.descrizio as dfermo, qcausafm.tipofm, | ||
| + | inner join shareddata.qcausafm on shareddata.qcausafm.codice=regfm.caufm | ||
| + | where codubi=' | ||
| + | order by tm | ||
| + | </ | ||