invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Command Line Options

Invantive Query Tool can be started with options on the command line. They are meant for automation, for support and for making reproducible screen captures; they do not replace the log on window.

An option is written as /name or /name=value. The forms -name and --name are accepted as well, and a colon may be used instead of the equals sign, so a script written for another shell or for another Invantive product keeps working. A value holding spaces is put between double quotes, together with the name of the option. Options are not case sensitive and may be given in any order. An argument which is no option of the product is ignored, and so is an option which needs a value but is given none. An option given more than once keeps the value of the last occurrence; only /open collects every value.

The following options are accepted:

  • /help, /?, /h: show the usage and end.
  • /signal=<text>: mark the run as a special one.
  • /execute=<statements>: execute the statements once a connection has been made.
  • /script=<file>: execute the statements read from the file.
  • /exitafterexecute: close the application once the statements have run.
  • /open=<file>: open the file as a document; may be repeated.
  • /nodocuments: start with one empty document and leave the documents of the previous session alone.
  • /acceptlicense=<variant code>: accept the licence agreement of that variant. See below.
  • /licenseinfo: write the state of the licence, the agreement and the personal information as JSON and end. See below.
  • /personfirstname=<name>, /personlastname=<name> and /personphonework=<number>: the first name, the last name and the work phone number of the user. See below.
  • /trace, /tracetofile and /tracefolder=<folder>: switch the trace on from the start. See below.

Asking for the Usage

Invantive.Producer.QueryTool.exe /help

The usage is written to the console of the shell that started the program. Invantive Query Tool is a windows application and has no console of its own, so it attaches to the one of the shell; when it is started without a shell, for instance from the Start menu, the usage is shown in a window instead. The program ends directly afterwards with exit code 0, before logging on.

/? and /h do the same, as do -h and --help.

The usage lists exactly the options above: it is composed from the same declarations with which the product reads its command line, so the two can not drift apart. Invantive Studio, Invantive Runtime, Invantive Data Loader, Invantive Estate for Windows, Invantive Business for Windows and Invantive Support Assistant answer /help in the same way and in the same notation, from release 27.0 onward.

Marking a Special Run

A run which is not a person going about their work can be marked, so the title bar of every window shows it:

Invantive.Producer.QueryTool.exe /signal="AI STARTED"

This is the same marker as the environment variable INVANTIVE_RUN_SIGNAL, which every Invantive product on this framework honours; see Run Signal for what it does, which products carry it, and how a window without a title bar shows it. The option marks this one run and leaves the environment of the shell alone. A /signal without a text is ignored, so a signal set in the environment variable stays in force.

Accepting the Agreement and Providing the User

Five options let a run without a person at the keyboard accept the licence agreement, provide the user and report what is left to answer. Available from release 27.0:

  • /acceptlicense=<variant code>: accept the agreement of the licence variant of the licence key in use. A code which is not that variant accepts nothing.
  • /personfirstname=<name>: the first name, used when the stored one is missing or not acceptable.
  • /personlastname=<name>: the last name, used in the same way.
  • /personphonework=<number>: the work phone number, used in the same way.
  • /licenseinfo: write the state of the licence, the agreement and the personal information as JSON and end, without changing anything.

The second spelling with dashes, such as /accept-license, is accepted as well, and so is the colon instead of the equals sign. Every option has an environment variable with the same effect, and the settings files record whether an answer was given in a window, on the command line or in the environment; see Unattended Start.

Tracing From the Start

Three options switch the trace on from the start of the product, so the start itself is traced without setting environment variables first. Available from release 27.0:

  • /trace: switch trace on.
  • /tracetofile: write the trace to a file as well, which also switches trace on.
  • /tracefolder=<folder>: the folder of the trace files as a full path, which also switches trace to file on. A folder which is not a full path ends the start with itgentsm009.

The second spelling with dashes, such as /trace-to-file, is accepted as well. Once the product runs, the pane "Trace" of the window "Preferences" changes the same settings without a restart. See Trace Settings.

Executing Statements

Statements can be handed over on the command line. They are put in a document of their own and executed once a connection has been made; logging on is not bypassed.

Invantive.Producer.QueryTool.exe "/execute=select 1 as x"
Invantive.Producer.QueryTool.exe "/script=C:\temp\report.sql" /exitafterexecute
  • /execute=<statements>: the statements to execute.
  • /script=<file>: a file holding the statements to execute. A file which does not exist executes nothing.
  • /exitafterexecute: close the application once they have run, which makes the product usable from a batch file. Without /execute or /script the option has no effect.

When both /execute and /script are given, the statements of /execute are executed and the file is not read. The statements are executed once per run; a second log on in the same session does not repeat them.

Note the quotes around the whole option, name included. A shell splits an unquoted value on its spaces, which would hand over only the first word.

The statements are run as a script, whatever their number. From release 27.0 onwards the licence must therefore cover the function itgen_querytool_execute_script, the same function "Execute All" needs; see Main Window. A run which is not covered reports the refusal in a window, so a batch file waits for that message to be acknowledged before /exitafterexecute closes the application.

Opening Documents

The documents to work on can be named on the command line. The option may be repeated, in which case the documents appear in the order given and the last one named is the one in front:

Invantive.Producer.QueryTool.exe "/open=C:\sql\daily.sql" "/open=C:\sql\month.sql"

A file which does not exist yet still becomes a document, empty and carrying that name, so the statements written in it can be saved under it straight away. A file which cannot be read is skipped, so one unreadable file does not keep the others closed.

Naming documents leaves the documents of the previous session alone, exactly as /nodocuments does below: the run states which documents it wants, so the stored ones are neither opened nor written back. Available from release 27.0.

Leaving the Documents of the Previous Session Alone

Invantive Query Tool opens the documents of the previous session again at start and writes them back at exit. A run which is not a person going about their work - a test, a screen capture, a reproduction for support - is to do neither:

Invantive.Producer.QueryTool.exe /nodocuments

The run then starts with one empty document, and the documents of the previous session are neither opened nor written back. Both halves matter: the statements of a user are personal data and may hold the data of their customers, so a capture or a log of such a run would disclose them, and a run which writes its own documents back replaces what the user had without leaving a trace. Available from release 27.0.

See Also

Release Notes