Subject Re: [firebird-support] DDL script - how to terminate on error?
Author Michael Ludwig
Michael Ludwig schrieb am 30.11.2010 um 23:16 (+0100):
> Thomas Steinmaurer schrieb am 30.11.2010 um 08:08 (+0100):
> > > Is there a way to instruct the INPUT command, or the
> > > server, to abort processing on the first error instead
> > > of trucking on down the script?
> >
> > Check out the SET BAIL [ON|OFF] command in isql.
> Thanks. I checked it out using the isql.exe coming with 1.5,
> 2.0, 2.1 and 2.5 on a 2.5 server. I fail to see any effect it
> might have on processing a batch file using the INPUT command.
> In other word, irrespective of my setting BAIL ON or OFF,
> processing of the INPUT script merrily rattles past errors.
> I would have expected the option to abort the script on the
> first error encountered.
> The description ("Bail on error") does sound as if it were
> exactly what I want, though.
> But my expectation might be wrong, so I've been looking for
> documentation. So far, my research has been surprisingly
> unsuccssful. There's nothing on BAIL in chapter 37 of Helen's
> book, which covers isql on pp.779-811 (SET commands on
> pp.801-7). Where's the missing manual?

The InterBase 6 OpGuide from 1999, the page numbers of which
nicely align with the PDF file numbers, makes no mention in
its coverage of the isql utility of either a -b option or the
SET BAIL command.

And indeed the -b(ail) switch seems to have been introduced
in Firebird 2.0. It's in the 2.0.6 release notes on page 88.
(Or page 98, if you look at the PDF file page numbers. Sorry,
couldn't help :-)

It's not entirely clear to me whether it is intended to abort
on, say, encountering a syntax error, or a missing dependency,
in a procedure definition. I would rather say so, though. If
it is, well, then it has a bug.

Michael Ludwig