Đã hoàn thành

TEXT column: Argument data type text is invalid for argument 1 of lower function 2

I currently have a repo method which is acting as a filter with pagination:

Repo:

@Query("SELECT e FROM DeTest e " +

"WHERE [login to view URL] = '9999-12-31 00:00:00.000' " +

"AND (:name is null OR LOWER ([login to view URL]) LIKE LOWER ('%' + :name+ '%')) " +

"AND (:description is null OR LOWER ([login to view URL]) LIKE LOWER ('%' + :description + '%')) " +

"AND (:theProblem is null OR LOWER ([login to view URL] ) LIKE LOWER ('%' + :theProblem + '%')) "

)

So as shown here, I have it so when you enter a value it will change it ensuring that both uppercase values and lowercase values are displayed. However, when adding LOWER to the 'theProblem' column, it produces the error in the title:

Argument data type text is invalid for argument 1 of lower function

My datatype for that particular column is text, and therefore, I think the culprit of the issue. However, due to the db layout I need it to be a text. Therefore, is there anyway I could convert/cast it in the repo method for when it's called?

Column:

@Column(name = "the_problem", columnDefinition = "TEXT") // text rather than varchar

private String theProblem;

Thank you.

Kĩ năng: Phát triển phần mềm, Java, Coding, Programming

Xem nhiều hơn: websites type text displayed, transaction refused invalid argument oscommerce, line error invalid argument, argument data type varbinary(max) is invalid for argument 1 of textptr function, argument data type varchar is invalid for argument 1 of format function, argument data type xml is invalid for argument 1 of stuff function, argument data type void type is invalid for argument 1 of string_split function, argument data type text is invalid for argument 2 of hashbytes function, argument data type text is invalid for argument 1 of replace function sql 2008, replace function in sql server text field, argument data type sql_variant is invalid for argument 1 of like function, warning invalid argument supplied foreach adminedit_orders, net documentviewer type text find, invalid argument supplied foreach pathwayphp line error, type text external file flash, invalid argument supplied foreach edit_ordersphp oscommerce, oscommerce invalid argument foreach edit_ordersphp, invalid argument supplied foreach edit_ordersphp, invalid argument supplied foreach joomla help, invalid argument supplied foreach oscommerce ordersphp

Về Bên Thuê:
( 0 nhận xét ) Belfast, United Kingdom

ID dự án: #27548647

Được trao cho:

deeptimayipadhi

I have 8+ years of experience in .net, JS, SQL and DB related changes. Please revert and contact for further communication.

£16 GBP trong 3 ngày
(0 Đánh Giá)
0.0

3 freelancer chào giá trung bình£18 cho công việc này

tanukumari1262

Hi I have read the description and can do the work.I have 8 years of experience in C,C++ and [login to view URL] me so we can further looking forward to work with you. Thanks

£20 GBP trong 1 ngày
(8 Nhận xét)
3.0
jamesbrown547

Hi, I am confident I can fix this query for you, I have often had to deal with similar issues with a TEXT column from older versions of SQL server when TEXT was the only option. I have 11 years experience as a SQL Deve Thêm

£17 GBP trong 7 ngày
(0 Nhận xét)
0.0