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

Line Spacing

An empty line separates one Invantive Script or Invantive UniversalSQL statement from the next. The split is textual and happens before a statement is parsed, so the vertical spacing of a script decides what its statements are.

A comment counts as a statement. An empty line is therefore written above and below every statement.

From release 27.0 onward there is one exception. A comment block written directly above a local statement belongs to that statement, and the statement runs. Up to and including release 26.0 such a statement failed, so a script which must also run on release 26.0 or older keeps the empty line between the comment and the local statement. The exception covers local statements only: a comment block directly above a set statement is still joined to it and the statement then fails.

The opposite holds within a statement. A PSQL block, a create or replace statement and a query spread over several lines hold no empty line at all, because the first one ends the statement halfway. A line holding only two hyphens provides the vertical space instead.

Examples

The second statement is not executed, because the empty line between the two is missing. The text of a local remark statement runs on to the end of the statement, so the line below it is read as part of the remark:

local remark The definition below is not executed.
local define OUT_PATH "c:\temp"

An empty line between the two makes both of them run:

local remark The definition below is executed.

local define OUT_PATH "c:\temp"

From release 27.0 onward a comment block directly above a local statement belongs to that statement, and the statement runs:

--
-- Folder the results are written to.
--
local define OUT_PATH "c:\temp"

Up to and including release 26.0 the block above fails. A script which must run on such a release writes an empty line between the comment and the statement:

--
-- Folder the results are written to.
--

local define OUT_PATH "c:\temp"

The block below is one statement, so the comment inside it is surrounded by a line holding only two hyphens. An empty line in either place would end the block at that point:

begin
  dbms_output.put_line('Start.');
  --
  -- Report what has been done.
  --
  dbms_output.put_line('Ready.');
end;