db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: SQL Parser failing on NULL column contraint
Date Wed, 30 Aug 2006 15:28:21 GMT
Duncan Groenewald wrote:
> Any chance someone can explain how I could modify the parser (or 
> whatever) to be able to handle the NULL constraint ?

Beware: I haven't tried this, but you could have a look at
java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj and
experimentally try to modify it for yourself.

In terms of the modifications, I think you'll want to look at the
subroutine columnConstraint(), and observe how the explicitNotNull
and explicitNull flags are handled.

Notice that there is an explicit parser block for

   <NOT> <NULL>

I think you'll either want to add a second explicit parser block for

   <NULL>

or modify the existing one to

   [<NOT>] <NULL>

and either way you want to make sure that you manage the explicitNull
and explicitNotNull flags properly, and that you call setNullability()
on the dataTypeDescriptor to record the user's NULL / NOT NULL choice.

Hope this helps,

bryan



Mime
View raw message