Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Between function doesn't work when run against Oracle database #974

Closed
jacdavwill opened this issue Jun 23, 2020 · 1 comment
Closed

Between function doesn't work when run against Oracle database #974

jacdavwill opened this issue Jun 23, 2020 · 1 comment

Comments

@jacdavwill
Copy link

When running exposed version 0.25.1, the following throws an exception(org.jetbrains.exposed.exceptions.ExposedSQLException: java.sql.SQLDataException: ORA-01861: literal does not match format string) when running against an Oracle database:

transaction(database) {
     myTable.select(Op.build { myTable.localDateTimeVar.between(LocalDateTime.now().minusDays(1), LocalDateTime.now()) })
}

whereas the following works just fine:

transaction(database) {
	myTable.select(
		listOf(  
			Op.build { myTable.localDateTimeVar greaterEq LocalDateTime.now().minusDays(1) },  
			Op.build { myTable.localDateTimeVar lessEq LocalDateTime.now() }  
		).compoundAnd()
	)
}

Both of these code examples work properly against an H2 database.

@Tapac
Copy link
Contributor

Tapac commented Jun 25, 2020

Fixed in master

@Tapac Tapac closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants