Subject Re: [firebird-support] Re: My First Procedure
Author Helen Borrie
At 09:50 AM 25/02/2009, Adam wrote:

>SET TERM is not a magical DSQL command, it simply tells iSQL to change
>the terminator character of a SQL command while you define some PSQL
>blocks.
>
>But outside iSQL (and other equivalent script runners) it really has
>no relevance.

Another way to put this is: line terminators have no relevance in SQL except in the data definition language for PSQL - where embedded statements must be terminated with a semi-colon.

ISQL is a tool that happens to follow the convention of requiring line terminators for all statements and isql commands passed to it, which it does for reasons that are purely local to the tool itself. By default isql interprets a semi-colon as an *isql* line terminator. When you are defining a PSQL object, the *tool* provides SET TERM[INATOR] as its way of letting you inform the *tool* to stop interpreting semi-colons as isql line terminators and start interpreting some other sequence as isql line terminators.

Furthermore, when you come to experiment with the EXECUTE BLOCK syntax, you'll need to use the semi-colon statement terminators *within* the embedded PSQL, as well. At the time the FB Book was written, we didn't have the capability to execute "live" PSQL in dynamic SQL statements.

./heLen