brain/03 Bereiche/KIT/Prozessdaten PDV Datenbank.md

74 lines
2.5 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Prozessdaten PDV Datenbank
tags:
- ressource
- hydra
date: 2026-04-17
---
Merkmale zu einem Arbeitsplatz (in grafischer Prozessanalyse)
```sql
SELECT distinct pp.process_param_name,
(case when
hy_pp.merkmal_bez is null
then pp.process_param_name
else {fn concat(pp.process_param_name, {fn concat(N': ', hy_pp.merkmal_bez)})} end)
FROM ana_pparam pp inner join ana_unit u on pp.unit_id = u.id
left outer join caq_merkmal hy_pp on pp.process_param_id = hy_pp.id
left outer join hyd_einheiten hy_u on u.unit_id = hy_u.id
left outer join ana_pdatref_pparam pdr_pp on pdr_pp.pparam_id = pp.id
left outer join ana_pdatref pdr on pdr.id = pdr_pp.pdatref_id
left outer join ana_wplace wpl on wpl.id = pdr.wplace_id
WHERE (((wpl.workplace_name = 'ENV_DR')))
```
Prozessdaten:
```sql
SELECT pdd.acquisition_time, pdd.decimal_value, pp.process_param_name, wpl.workplace_name
FROM ana_process_data_decimal pdd
inner join ana_pdatref_pparam_datasup pdr_pp_ds on pdr_pp_ds.id = pdd.pdatref_pparam_datasup_id
inner join ana_pdatref_pparam pdr_pp on pdr_pp.id = pdr_pp_ds.pdatref_pparam_id
inner join ana_pparam pp on pp.id = pdr_pp.pparam_id
inner join ana_pdatref pdr on pdr.id = pdr_pp.pdatref_id
inner join ana_wplace wpl on wpl.id = pdr.wplace_id
WHERE ((pdd.acquisition_time between {ts '2026-01-06 08:56:27'}
and {ts '2026-02-06 12:56:27'})
```
Link-ID zu einem Workplace ermitteln
```sql
SELECT
ds.id AS pdatref_pparam_datasup_id,
pp.*,
p.*,
pd.*,
w.*
FROM ana_pdatref_pparam_datasup ds -- Combinations of process data references, process parameters and data suppliers of the analysis data pool.
JOIN ana_pdatref_pparam pp ON ds.pdatref_pparam_id = pp.id -- combinations of process data references and process parameters of the analysis data pool.
JOIN ana_pparam p ON pp.pparam_id = p.id -- process parameters of the analysis data pool.
JOIN ana_pdatref pd ON pp.pdatref_id = pd.id -- process data references of the analysis data pool
JOIN ana_wplace w ON pd.wplace_id = w.id -- workplaces of the analysis data pool
WHERE w.workplace_name = 'ENV_DR'
AND p.process_param_name =
'HPR_V_TEMP';
```
mit pdatref_pparam_datasup_id kann anschießend in ana_process_data_decimal selektiert werden (auch in den exportierten URN Dateien)
res_bestand:
RES_ID = 102085
RES_NR = ENV_DR   (= ana_workplace.id)
Staging-Tabelle:
stg_process_data_batch