Script don't stop if I have an error

186 views
Skip to first unread message

Enrico Briozzi

unread,
Dec 18, 2015, 4:43:50 AM12/18/15
to sql-workbench
Hi Tomas,
I'm using SQL Workbench/J build 118.7 with JDK 1.8.0_45 (64 bit) in Ubuntu 15.10.

When I run two query and the first one has an error, the program don't stop for asking me if I want to go on or cancel. I don't have "Ignore all errors during script execution" active.

For example you can run:
select * from DUAL where;
select * from DUAL;

My configuration is:

Product Name: Oracle
Product Version: 11.2
Product Info: Oracle Database 11g Release 11.2.0.4.0 - 64bitProduction
Driver Name: Oracle JDBC driver
Driver Class: oracle.jdbc.OracleDriver
Driver Version: 11.2.0.3.0
URL: jdbc:oracle:thin:@prod3kdb:1521:PROD
Isolation Level: READ COMMITTED
Username: ST3K
Schema:ST3K
Catalog:
Workbench DBID: oracle
ConnectionID: WbWin-1

FEATURE                                               | VALUE        
------------------------------------------------------+---------------
allProceduresAreCallable                              | false        
allTablesAreSelectable                                | false        
catalogSeparator                                      |              
catalogTerm                                           |              
dataDefinitionCausesTransactionCommit                 | true         
dataDefinitionIgnoredInTransactions                   | false        
defaultIsolationLevel                                 | READ COMMITTED
extraNameCharacters                                   | $#           
identifierQuoteString                                 | "            
maxCharLiteralLength                                  | 2000         
maxColumnNameLength                                   | 30           
maxColumnsInIndex                                     | 32           
maxStatementLength                                    | 65535        
maxTableNameLength                                    | 30           
maxTablesInSelect                                     | 0            
nullPlusNonNullIsNull                                 | true         
nullsAreSortedAtEnd                                   | false        
nullsAreSortedAtStart                                 | false        
procedureTerm                                         | procedure    
schemaTerm                                            | schema       
searchStringEscape                                    | /            
storesLowerCaseIdentifiers                            | false        
storesLowerCaseQuotedIdentifiers                      | false        
storesMixedCaseIdentifiers                            | false        
storesMixedCaseQuotedIdentifiers                      | true         
storesUpperCaseIdentifiers                            | true         
storesUpperCaseQuotedIdentifiers                      | false        
supportsANSI92EntryLevelSQL                           | true         
supportsANSI92FullSQL                                 | false        
supportsANSI92IntermediateSQL                         | false        
supportsAlterTableWithAddColumn                       | true         
supportsAlterTableWithDropColumn                      | false        
supportsBatchUpdates                                  | true         
supportsCatalogsInDataManipulation                    | false        
supportsCatalogsInIndexDefinitions                    | false        
supportsCatalogsInProcedureCalls                      | false        
supportsCatalogsInTableDefinitions                    | false        
supportsColumnAliasing                                | true         
supportsCoreSQLGrammar                                | true         
supportsCorrelatedSubqueries                          | true         
supportsDataDefinitionAndDataManipulationTransactions | true         
supportsDataManipulationTransactionsOnly              | true         
supportsFullOuterJoins                                | true         
supportsGetGeneratedKeys                              | true         
supportsLikeEscapeClause                              | true         
supportsMixedCaseIdentifiers                          | false        
supportsMixedCaseQuotedIdentifiers                    | true         
supportsMultipleResultSets                            | false        
supportsMultipleTransactions                          | true         
supportsSavepoints                                    | true         
supportsSchemasInDataManipulation                     | true         
supportsSchemasInIndexDefinitions                     | true         
supportsSchemasInProcedureCalls                       | true         
supportsSchemasInTableDefinitions                     | true         
supportsStoredProcedures                              | true         
supportsSubqueriesInComparisons                       | true         
supportsSubqueriesInExists                            | true         
supportsSubqueriesInIns                               | true         
supportsTableCorrelationNames                         | true         
supportsTransactions                                  | true         
supportsUnion                                         | true         
supportsUnionAll                                      | true         

Log:

DEBUG 2015-12-18 10:20:24 Using regex for line#: (?i)\s(line|zeile)\s[0-9]+, regex for column#: (?i)\s(column|spalte)\s[0-9]+
DEBUG 2015-12-18 10:20:24 Error at position: 24 reported by Oracle
ERROR 2015-12-18 10:20:24 Error executing:
select * from DUAL where
   ORA-00936: missing expression [SQL State=42000, DB Errorcode=936]
java.sql.SQLSyntaxErrorException: ORA-00936: missing expression

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:873)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1491)
    at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:406)
    at workbench.sql.commands.SelectCommand.execute(SelectCommand.java:137)
    at workbench.sql.StatementRunner.runStatement(StatementRunner.java:551)
    at workbench.gui.sql.SqlPanel.displayResult(SqlPanel.java:3371)
    at workbench.gui.sql.SqlPanel.runStatement(SqlPanel.java:2140)
    at workbench.gui.sql.SqlPanel$4.run(SqlPanel.java:2091)

ERROR 2015-12-18 10:20:24 Error executing on EventQueue java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
    at java.awt.EventQueue.invokeAndWait(EventQueue.java:1319)
    at java.awt.EventQueue.invokeAndWait(EventQueue.java:1294)
    at workbench.gui.WbSwingUtilities.invoke(WbSwingUtilities.java:222)
    at workbench.gui.ErrorContinueDialog.askContinue(ErrorContinueDialog.java:66)
    at workbench.gui.sql.SqlPanel.askContinue(SqlPanel.java:3713)
    at workbench.gui.sql.SqlPanel.handleScriptError(SqlPanel.java:3649)
    at workbench.gui.sql.SqlPanel.displayResult(SqlPanel.java:3482)
    at workbench.gui.sql.SqlPanel.runStatement(SqlPanel.java:2140)
    at workbench.gui.sql.SqlPanel$4.run(SqlPanel.java:2091)
Caused by: java.lang.NullPointerException

DEBUG 2015-12-18 10:20:35 Restoring window position for 'workbench.gui.components.LogFileViewer', current screen size: [x: 0, y: 0, w:1920,h:1080], requested position: [x: 730, y: 177, w:800,h:600]

Thank you very much, best regards
Enrico.-


Thomas Kellerer

unread,
Dec 18, 2015, 5:31:46 AM12/18/15
to sql-wo...@googlegroups.com
This part:

> ERROR 2015-12-18 10:20:24 Error executing on EventQueue java.lang.reflect.InvocationTargetException
> java.lang.reflect.InvocationTargetException
> at java.awt.EventQueue.invokeAndWait(EventQueue.java:1319)
> at java.awt.EventQueue.invokeAndWait(EventQueue.java:1294)
> at workbench.gui.WbSwingUtilities.invoke(WbSwingUtilities.java:222)

This looks like a Java problem. Apparently the dialog box to show you the error can not be displayed.

But I have no idea how that could happen. Is than Oracle Java or is that OpenJDK?

It wouldn't be the first time I see problems with OpenJDK and Swing.

Thomas
> Enrico.-

Enrico Briozzi

unread,
Dec 18, 2015, 5:52:04 AM12/18/15
to sql-workbench
Hi Thomas,
I test with the same Java and Oracle on old versions of SQL Workbench/J, with all build 118 (118.1, 118.2, 118.5) I have the error. With build 117.7 all is ok, the dialog appears.

My java is:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
It's JDK from Oracle site installed manually in a directory and set my $JAVA_HOME to bypass the Ubuntu package.

Below the log for build 117.7:

DEBUG 2015-12-18 11:43:07 Using regex for line#: (?i)\s(line|zeile)\s[0-9]+, regex for column#: (?i)\s(column|spalte)\s[0-9]+
DEBUG 2015-12-18 11:43:07 Error at position: 24 reported by Oracle
ERROR 2015-12-18 11:43:07 Error executing:

select * from DUAL where
   ORA-00936: missing expression [SQL State=42000, DB Errorcode=936]
java.sql.SQLSyntaxErrorException: ORA-00936: missing expression

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:873)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1491)
    at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:406)
    at workbench.sql.commands.SelectCommand.execute(SelectCommand.java:135)
    at workbench.sql.StatementRunner.runStatement(StatementRunner.java:545)
    at workbench.gui.sql.SqlPanel.displayResult(SqlPanel.java:3383)
    at workbench.gui.sql.SqlPanel.runStatement(SqlPanel.java:2164)
    at workbench.gui.sql.SqlPanel$14.run(SqlPanel.java:2115)

DEBUG 2015-12-18 11:43:12 Restoring window position for 'workbench.gui.components.LogFileViewer', current screen size: [x: 0, y: 0, w:1920,h:1080], requested position: [x: 730, y: 177, w:800,h:600]

Thank you very much, best regards
Enrico.-


--
You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Kellerer

unread,
Dec 18, 2015, 6:37:50 AM12/18/15
to sql-wo...@googlegroups.com
What have you selected for the "error prompt" type?

Tools -> Options -> SQL Execution -> Error prompt for scripts.

Thomas
> Enrico.-
>
> 2015-12-18 11:31 GMT+01:00 Thomas Kellerer <google...@sql-workbench.net <mailto:google...@sql-workbench.net>>:
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbench%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.

Enrico Briozzi

unread,
Dec 18, 2015, 6:55:08 AM12/18/15
to sql-workbench
Hi Thomas,
my option is: "Include error message".

But I never set it.
I test "Simple prompt" and the dialog appears: "ignore this error", "Ignore all errors" or "Stop script".
I test "Show statement and allow retry" and the dialog with SQL appears and you can change sql and do retry, but no result tab for the corrected query appears...

Thank you very much, best regards
Enrico.-

To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com.

Thomas Kellerer

unread,
Dec 18, 2015, 6:58:48 AM12/18/15
to sql-wo...@googlegroups.com


> my option is: "Include error message".
> I test "Simple prompt" and the dialog appears: "ignore this error", "Ignore all errors" or "Stop script".

Hmm, so when you set it to "Include error message" you don't see the dialog?

> I test "Show statement and allow retry" and the dialog with SQL appears and you can change sql and do retry,
> but no result tab for the corrected query appears...

Yes, that's by design.
The "Retry" option is intended to correct errors in DDL or other statements that don't produce a result set.


Thomas

> 2015-12-18 12:37 GMT+01:00 Thomas Kellerer <google...@sql-workbench.net <mailto:google...@sql-workbench.net>>:

Enrico Briozzi

unread,
Dec 18, 2015, 7:05:25 AM12/18/15
to sql-workbench
Hi Thomas,

> my option is: "Include error message".
> I test "Simple prompt" and the dialog appears: "ignore this error", "Ignore all errors" or "Stop script".

Hmm, so when you set it to "Include error message" you don't see the dialog?
 
Yes, I don't see any dialog,
In messages I see:

An error occurred when executing the SQL command:

select * from DUAL where

ORA-00936: missing expression (position: 24)

select * from DUAL where
                        ^

Execution time: 0s
Statement 1 of 2 finished
SELECT executed successfully

Execution time: 0s
Statement 2 of 2 finished
1 statement failed.
Script execution finished
Total script execution time: 0.01s

I have the red row in the error's statement and if I run it again:

An error occurred when executing the SQL command:

select * from DUAL where

ORA-00936: missing expression (position: 24)

select * from DUAL where
                        ^

Execution time: 0.01s

1 statement failed.



> I test "Show statement and allow retry" and the dialog with SQL appears and you can change sql and do retry,
> but no result tab for the corrected query appears...

Yes, that's by design.
The "Retry" option is intended to correct errors in DDL or other statements that don't produce a result set.

Ok.

Thomas Kellerer

unread,
Dec 18, 2015, 7:16:22 AM12/18/15
to sql-wo...@googlegroups.com
So at least you have a workaround, that's good.

I currently don't know why including the error message results in this error.

There is a NullPointerException in the log as well, so I assume it is some UI initialization problem that is caused by your Java Version, your OS and the desktop you are using.

I will try if I can reproduce that somehow, but I will make the code more robust against potential Java/Swing problems.

Regards
Thomas
> Enrico.-
>
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.

Thomas Kellerer

unread,
Dec 18, 2015, 4:46:19 PM12/18/15
to sql-wo...@googlegroups.com
I tested this with different Linux distribution and desktops and it happens on all of them.

For some reason the creation of the dialog fails, because some fonts are not initialized properly there.

It happens with OpenJDK and the Oracle JDK.

Thanks for reporting, I have fixed that.

Regards
Thomas


Enrico Briozzi schrieb am 18.12.2015 um 10:43:
> Hi Tomas,
> I'm using SQL Workbench/J build 118.7 with JDK 1.8.0_45 (64 bit) in Ubuntu 15.10.
>
> When I run two query and the first one has an error, the program don't stop for asking me if I want to go on or cancel.
>I don't have "Ignore all errors during script execution" active.
>
> For example you can run:
> select * from DUAL where;
> select * from DUAL;
>
>
Reply all
Reply to author
Forward
0 new messages