Beruflich Dokumente
Kultur Dokumente
In the examples shown below we concentrate in obtaining information from the Result
Database. This can be useful for instance to add to the operating instructions information
regarding equipment contents, streams or emissions.. This document assumes a basic
knowledge of SQL (Structured Query Language).
Introduction
For details in how to create and edit a Batch Plus Operating Instruction Templates see the
Online Help. To Use SQL Plus, edit a Batch Plus Operating Instructions Template (select
File->Preferences->Operating Instructions) and click Edit. From the Batch Plus menu in
Word, select Edit Standard Statement. In the standard statement template select the point
where you want to insert information from SQL Plus. Select SQL Plus from the Batch
Plus menu in Word. In the database dropdown select the database you want to query. All
the examples below use the Result Database. From the return data type select the type of
the return value (string, double or long). Notice that the query should return only one
field and its data type should be of the same type selected in the data type dropdown. As
explained below the query can return multiple records and therefore Batch Plus will
return multiple values, separated by commas, of the field used in the select query.
Examples
Contents of equipment units
The following query selects the mass of the liquid phase in the equipment unit at the end
of the current operation in the recipe. Notice the use of the keyword bpoperationid.
This indicates the operation id of the current operation in the recipe. This keyword is used
by Batch Plus to substitute the id of the operation being processed when generating the
operating instructions.
SELECT EquipmentContents.Mass*ThermodynamicPhase.MassPhaseFraction as dvalue
FROM ThermodynamicPhase INNER JOIN EquipmentContents ON
ThermodynamicPhase.ContentsID = EquipmentContents.ContentsID
WHERE ((ThermodynamicPhase.Phase="Liquid1") AND
(EquipmentContents.OperationID=bpoperationid))
The following query gets the names, separated by commas, of all the components in the
liquid phase of the equipment unit corresponding to the current operation in the recipe.
Notice again the key work bpoperationid
SELECT PureComponents.MaterialName as strvalue
FROM ((PhaseComponents INNER JOIN ThermodynamicPhase ON
PhaseComponents.PhaseID = ThermodynamicPhase.PhaseID) INNER JOIN
EquipmentContents ON ThermodynamicPhase.ContentsID =
Stream Information
To obtain the user-defined labels of all the streams associated with a given operation in
the recipe use the following query.
SELECT StreamSummary.UserLabel as strvalue
FROM StreamSummary
WHERE (((StreamSummary.OperationID)= bpoperationid))
As before this query will give the stream labels of all the streams associated with a given
operation separated by commas. The above query can be complemented by a query that
will give the mass or volumetric flow rate or any average property of the stream. For
instance, to obtain the volumetric flow rate use the following query.
Keywords