vendredi 15 janvier 2016

Testing date values with HSQLDB

We use SQLServer in production, but HSQLDB for our integration tests. HSQLDB is used because it's an in-memory database.

I have an SQLServer SQL that executes the following code:

select convert(varchar(8), pos_val_date, 112) 
from wscpos;

In HSQLDB, this does not work. The code should be:

select to_char( pos_val_date, 'YYYYMMDD')
from wscpos;

What's the best practice to adapt my code such that it runs both in production and in my integration test?

Aucun commentaire:

Enregistrer un commentaire