It seems that running the following SQL statement results in an error in Derby, while it’s working fine in other DBs (such as Oracle or Sybase):



   a as “ColumnA”,

  null as “ColumnB”

from SomeTable


java.sql.SQLSyntaxErrorException: Syntax error: Encountered "null" at line 10, column 2.

                at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)

                at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)

                at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)

                at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)

                at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)

                at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)

                at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)


Is this by design? And is there a work-around? What needs to be done to set a column to null?


Thank you,


Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.