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

Error using TRIM on SQL SERVER #722

Closed
michele-grifa opened this issue Dec 10, 2019 · 3 comments
Closed

Error using TRIM on SQL SERVER #722

michele-grifa opened this issue Dec 10, 2019 · 3 comments

Comments

@michele-grifa
Copy link

Hi, i'm using the trim function in my project that retrieve some data from SQL Server.
In SQL Server 2017, the query works well, but on lower versions it gave me the error:

trim is not a recognized built-in function name sql server

I know that the trim function is not supported in SQL Server lower than 2017, but Exposed shouldn't adapt the query?
The odbc driver i'm using is:

com.microsoft.sqlserver:mssql-jdbc:7.4.1.jre8

@Tapac
Copy link
Contributor

Tapac commented Dec 10, 2019

@HawkEye4 , sorry but it's not possible to track and support all dialect changes in all databases, but you always can make your own function like:

fun Column<String?>.trim2017() = function("LTRIM").function("RTRIM")

@michele-grifa
Copy link
Author

@HawkEye4 , sorry but it's not possible to track and support all dialect changes in all databases, but you always can make your own function like:

fun Column<String?>.trim2017() = function("LTRIM").function("RTRIM")

Where should I place this function?

@michele-grifa
Copy link
Author

Thanks, the code worked.

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