---
title: "Esimerkki er\u00E4tiedostosta"
description: "Invantive Data Hub k\u00E4ynnistet\u00E4\u00E4n yleens\u00E4 er\u00E4tiedostosta, kuten alla olevassa esimerkiss\u00E4."
language: fi
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fi/docs/invantive-data-hub/sample-batch-file
original: https://documentation.invantive.eu/en/docs/invantive-data-hub/sample-batch-file
updated: 2026-12-04T01:05:34Z
license: https://documentation.invantive.eu/fi/
---

Invantive Data Hub käynnistetään yleensä erätiedostosta, kuten alla olevassa esimerkissä. Sisällön avulla erätiedoston voi luoda käsin, mutta Invantive Query Tool luo tällaisen erätiedoston helpommin, kuten kohdassa [[Batch File]] kuvataan.

```bat
@echo off
rem
rem Batch script to run an Invantive SQL file with possible Invantive Script statements.
rem
rem Please note that the encrypted password is bound to the PC used to generate this file.
rem When you want to run this batch file on another PC, please generate a new encrypted password at that PC.
rem
rem In Invantive Query Tool and Data Hub you can use the 'local encrypt password' statement to generate.
rem a new encrypted password.
rem
rem As an alternative you can use cloud.invantive.eu to generate a pre-authenticated connection.
rem
rem Find more information on documentation.invantive.eu.
rem
rem Created by Invantive Query Tool on 03/10/2026 16:16:42 (UTC).
rem

set INVANTIVE_USR=<<USERNAME>>

set INVANTIVE_ENCRYPTED_PWD=<<ENCRYPTED_PWD>>

set INVANTIVE_DB=<<GROUP>>\<<NAME>>

set INVANTIVE_SQL_FILE=C:\temp\file.sql

set INVANTIVE_LOG_FILE=file-%%Y%%m.log

set INVANTIVE_LOG_FILE_OVERWRITE=False

set INVANTIVE_INTERACTIVE=False

set INVANTIVE_PRG=C:\Program Files (x86)\Invantive Software BV\Invantive Data Hub 26.0\Invantive.Producer.Data.Hub.exe

"%INVANTIVE_PRG%" /verbose /database:"%INVANTIVE_DB%" /user:"%INVANTIVE_USR%" /encryptedpassword:"%INVANTIVE_ENCRYPTED_PWD%" /file:"%INVANTIVE_SQL_FILE%" /logfile:"%INVANTIVE_LOG_FILE%" /logoverwrite:"%INVANTIVE_LOG_FILE_OVERWRITE%" /interactive:%INVANTIVE_INTERACTIVE%

IF %ERRORLEVEL% NEQ 0 (
  echo Job failed with exit code %ERRORLEVEL%.
  exit /b %ERRORLEVEL%
)

echo Completed job with exit code %ERRORLEVEL%.
```

Erätiedosto päättyy Invantive Data Hubin paluukoodiin, joten ajastin näkee, onnistuiko ajo; katso [[Exit Code]]. Lokitiedoston nimi sisältää vuoden ja kuukauden UTC-ajassa (`%Y%m`), joten jokaiselle kuukaudelle tulee oma lokitiedosto.

`INVANTIVE_PRG` nimeää asennetun julkaisun kansion. Julkaisuun 27.0 asti ja mukaan lukien Invantive Data Hub asentuu kansioon `C:\Program Files (x86)\Invantive Software BV`, kuten esimerkissä; julkaisusta 27.1 alkaen se asentuu kansioon `C:\Program Files\Invantive Software BV`, esimerkiksi `C:\Program Files\Invantive Software BV\Invantive Data Hub 27.1\Invantive.Producer.Data.Hub.exe`. Erätiedosto muuttuu siis joka tapauksessa julkaisun mukana.



## Julkaisutiedot

- [Invantive Data Hub](/fi/release-notes/products/invantive-data-hub)
  - [26.0 – 27.0](/fi/release-notes/products/invantive-data-hub?step=26.0-to-27.0)
  - [25.0 – 26.0](/fi/release-notes/products/invantive-data-hub?step=25.0-to-26.0)
