OpenGamma / ElSql

Manage external SQL files in Java with a little DSL goodness
Other
101 stars 26 forks source link

@VALUE does not work correctly when followed by whitespace #10

Closed julianhowarth closed 9 years ago

julianhowarth commented 9 years ago

My test case is trying to select from a sequence, but this is a more general issue. When I try the following using HSQLDB:

  SELECT NEXT VALUE FOR @VALUE(:sequenceName) AS next_id
  FROM (VALUES (0))

and pass my_seq as the sequence name variable, the SQL gets translated to:

  SELECT NEXT VALUE FOR MY_SEQAS next_id
  FROM (VALUES (0))

rather than:

  SELECT NEXT VALUE FOR MY_SEQ AS next_id
  FROM (VALUES (0))

i.e. the whitespace is gobbled and the statement therefore fails