Skip to content

Recommendations before loading scripts

In this page you can find a set of basic recommendations to be read before you start loading scripts.

When a stored procedure should be used

Data load using a stored procedure is typically designed to execute paged data reading. It is recommended that you use a stored procedure when the complexity of the load query is such that a view would not guarantee an adequate performance, for example when you want to join multiple tables or temporary support tables are required.

In the script set in the stored procedure you must always sort by a unique field (source key), that is, never use the date for ORDER BY because the date could change and therefore the sorting, so some data may not enter.

No fixed value in the past or equal to GetUtcDate for RowInserted and RowUpdated columns

The “RowInserted” and “RowUpdated” columns are used by ETLs to understand which data has been inserted or modified starting from the last successful execution. If the RowUpdated column in particular has a fixed value in the past or a value equal to the “GetUtcDate”, that data may never be loaded nor updated because the entity will always be outside the ETL time window. This is why the real insertion and update dates of the data source must always be retrieved to fill the RowInserted and RowUpdated columns. In particular, they need to be retrieved when multiple joins between different entities are executed, as in that case all possible updates of all related entities have to be considered.

Every time they are executed, ETLs define the time window to be considered at the beginning of the execution (T0, T1) using T0 as the final date and time of the last time window completed successfully and T1 as “GetUtcDate”.

The example below shows what happens if the GetUtcDate is put in the RowUpdated column. As the two “GetUtcDate” functions would be executed in different moments, the one inserted in the custom entity script would always be after the one in the time window. As a consequence, data is never stored in the data warehouse or is never updated.

example

In the script only refer to data source entities

Custom entity scripts must not contain any reference to bm20Load entities, nor to any other structure created by Opcenter Intelligence in the contract layer, but only refer to the entities of the current data source.


Last update: October 26, 2026