> For the complete documentation index, see [llms.txt](https://docs.videc.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videc.de/june5-3.7/en/datenquellenunterstuetzung-und-einbindung/honeywell-experion-batch-heb/sql-befehl-unit-batch.md).

# SQL Command Unit Batch

The command to determine unit batches from HEB data sources is a SQL statement that is structured according to the following syntax:

```
SELECT
[TPB_VW_PROC_EXEC].[USERPROCEDUREID] AS [LotNumber]
,[TPB_VW_PROC_EXEC].[STARTTIME] AS [Start]
,[TPB_VW_PROC_EXEC].[ENDTIME] AS [End]
,[TPB_VW_EQ].[NAME] AS [BatchID]
,[TPB_VW_EQ].[FULLNAME] AS [Namespace]
,[TPB_VW_PROC_EXEC].[DURATION] AS [Duration]
,[TPB_VW_PROC_EXEC].[PROCEDUREEXECUTIONID] AS [ProductID]
,[TPB_VW_EQ].[EQUIPMENTLEVELNAME] AS [UnitBatchID]
FROM
[ProcedureAnalyst].[pa].[TPB_VW_PROC_EXEC],
[ProcedureAnalyst].[pa].[TPB_VW_PROC],
[ProcedureAnalyst].[pa].[TPB_VW_EQ]
WHERE
[ProcedureAnalyst].[pa].[TPB_VW_PROC_EXEC].[PROCEDUREID]=[ProcedureAnalyst].[pa].[TPB_VW_PROC].[PROCEDUREID] AND
[ProcedureAnalyst].[pa].[TPB_VW_PROC_EXEC].[EQUIPMENTID]=[ProcedureAnalyst].[pa].[TPB_VW_EQ].[EQUIPMENTID] AND
[ProcedureAnalyst].[pa].[TPB_VW_EQ].[EQUIPMENTLEVELNAME]= 'Unit' AND
[ProcedureAnalyst].[pa].[TPB_VW_PROC].[PROCEDURELEVELNAME] = 'Unit Procedure' AND
[ProcedureAnalyst].[pa].[TPB_VW_PROC_EXEC].[STARTTIME] >= <<TS_From>> AND
[ProcedureAnalyst].[pa].[TPB_VW_PROC_EXEC].[ENDTIME] <= <<TS_To>>
```

This SQL command contains both keywords and alias names.

The keywords ***<\<TS\_From>>*** and ***<\<TS\_To>>*** are enclosed in double angle brackets. At runtime, they are replaced with the start time and end time of the query, respectively, to limit the query time period.

The alias names appear in square brackets to the right of the word "AS". When editing this command, note that the content of the columns assigned to the alias names \[Start] and \[End] are timestamp values.

{% hint style="info" %}
The keywords **<\<TS\_From>>** and **<\<TS\_To>>** and the alias names in the command do not need to be modified.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.videc.de/june5-3.7/en/datenquellenunterstuetzung-und-einbindung/honeywell-experion-batch-heb/sql-befehl-unit-batch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
