13

I need to create a HIGH date in HSQLDB and the solution is eluding me. I need something like

Date(9999-12-31 0:0:0)

but I cannot find a function or whatever to do it. I am loding the date via Spring on startup and i need something like:

insert intoMOD (
  ITM_INST_ELECTR_MOD_STRT_TS,
  ITM_INST_ID,
  ELECTR_MOD_ID,
  ITM_INST_ELECTR_MOD_END_TS
) VALUES (
  CURRENT_DATE,
  0,
  0,
  Date(9999-12-31 0:0:0)
)

What is the way to create a specific data using SQL in Hypersonic?

markthegrea
  • 3,731
  • 7
  • 55
  • 78

2 Answers2

17

Given the user guide, I'd expect the following to work:

DATE '9999-12-31'

or, if you need more than day precision:

TIMESTAMP '9999-12-31 00:00:00'
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 2
    Thanks. I couldn't find it. My google fu failed me. I can't believe there are no parenthesis around the date... – markthegrea Oct 30 '12 at 15:15
5

I was struggling with this problem and I think that I can contribute to help some other people.

Here is the insert that you need to put on your script while loading hsqldb:

insert intoMOD (
  ITM_INST_ELECTR_MOD_STRT_TS,
  ITM_INST_ID,
  ELECTR_MOD_ID,
  ITM_INST_ELECTR_MOD_END_TS
) VALUES (
  CURRENT_DATE,
  0,
  0,
  '9999-12-31'
)

HSQLDB converts the string automatically.

I tested with latest version (2.3.3).