1

I'am using micronaut data jpa and the query works fine with oracle but not with H2 database. here is the query : delete from myTable where (some conditions) AND (to_char(startDate, 'DY', 'NLS_DATE_LANGUAGE = ENGLISH') IN ('MON', 'TUE', 'WED', 'THU', 'FRI')) (some conditions)

The problem is the query do the right job in the oracle database but my tests fails in H2 database.

the test pass only when i replace ('MON', 'TUE', 'WED', 'THU', 'FRI') by (1,2,3,4,5), but it doesn't work well since the first day in America is Sunday and not Monday, so it shifts by one day.

Thanks in advance for your help.

i've tried many solutions like setting NLS_DATE_LANGUAGE...

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
BOS
  • 13
  • 3
  • 1
    That is not a JPA query, it is a SQL query. And SQL leaves a ton of wiggle room for implementations. Use Oracle for testing instead of H2. Take a look at Testcontainers. – Jens Schauder Dec 07 '22 at 17:49

0 Answers0