sagarswathi / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

RunScript with continueOnError flag #390

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

continueOnError flag is working only for the first script level and not inherit 
when executing "sub scripts" with RUNSCRIPT FROM command

For example if I use populateH2.sql which contains the following lines:
RUNSCRIPT FROM 1.sql
RUNSCRIPT FROM 2.sql

When I use -continueOnError e.g. 
java -cp h2-1.3.163.jar org.h2.tools.RunScript -url jdbc:h2:file:../test 
-script populateH2.sql -continueOnError

The execution of 1.sql queries will still stop on error and execution of 2.sql 
will start

Original issue reported on code.google.com by White...@gmail.com on 10 Apr 2012 at 1:07

GoogleCodeExporter commented 8 years ago
Hi,

I'm sorry but this feature isn't supported. I don't plan to add support for it 
currently, but patches are welcome. It might make sense to add an option to the 
RUNSCRIPT statement, as follows:

RUNSCRIPT FROM 's1.sql' CONTINUE_ON_ERROR;

But I think "inherit" would be more complicated. The RunScript tool is generic 
(runs with all databases) and so doesn't have anything H2 specific. And the 
RUNSCRIPT statement doesn't know it's running within a RunScript tool.

So the BNF would be:
RUNSCRIPT FROM fileNameString [ scriptCompression ]
[ CONTINUE_ON_ERROR ]
[ CIPHER cipher PASSWORD string ] [ CHARSET charsetString ]

I added this to the roadmap.

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 13 Apr 2012 at 4:56