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:30] f.zoppini [Quering samples] |
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 72: | Line 73: | ||
| |**regfm**(__codice__, | |**regfm**(__codice__, | ||
| - | ==== Quering samples | + | ==== Sample queries |
| Produced items on June 18th 2018 with date, time, unique identifier, production resource description, | Produced items on June 18th 2018 with date, time, unique identifier, production resource description, | ||
| <code sql> | <code sql> | ||
| - | select data, ora, codlot, prodline.descrizio | + | SELECT DATA, ora, codlot, prodline.descrizio |
| - | inner join prodline | + | INNER JOIN shareddata.prodline |
| - | inner join unitprod | + | INNER JOIN shareddata.unitprod |
| - | where data=' | + | WHERE DATA=' |
| - | order by tm | + | 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) | Count produced items after June 18th 2018 (included) grouped by day, article code and work order on production resource 821102A (DMG LB) | ||
| <code sql> | <code sql> | ||
| - | select data, unitprod.dart, | + | select data, unitprod.dart, |
| - | inner join unitprod on unitprod.codice=regprod.codlot | + | inner join shareddata.unitprod on shareddata.unitprod.codice=shareddata.regprod.codlot |
| where regprod.codubi=' | where regprod.codubi=' | ||
| group by data, dart, procord | group by data, dart, procord | ||
| Line 90: | Line 91: | ||
| 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, | 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> | <code sql> | ||
| - | select data, ora, tmdiff/60 as dtm, tipoevento, | + | select data, ora, tmdiff/60 as dtm, tipoevento, |
| - | inner join causafm | + | inner join shareddata.qcausafm |
| where codubi=' | where codubi=' | ||
| order by tm | order by tm | ||
| </ | </ | ||