select() function, query

Hello together,
for the following select query statement I get an error:
"select Algo_ID from egs_pn_algos where Algo_Version like '%1.0%' and Algo_hyperparameter like '%th:32;min_p_s:0.12;w_s:250%'"
The error is:
Error using database.jdbc.connection/select (line 78)
Invalid SQL statement. Expected a single SQL SELECT statement.
Error in DatabaseHandler/select_query (line 162)
data = select(obj.connection, query_str);
This query worked for me in sql developer.
What am I doing wrong

5 个评论

Can you try to make a MWE so we can run your code without any other dependencies and can reproduce your issue?
Roman
Roman 2020-11-23
编辑:Roman 2020-11-23
Hello together,
I found out, that it has to do with the second 'and'-statement.
I think '%th:32;min_p_s:0.12;w_s:250%' seems to be the problem.
What is wrong with it, because in sql developer it works perfectly fine.
Perhaps this might help.
Thanks
Perhaps you need to escape the semicolons? My experience with SQL is limited to SQLite.
What you posted also isn't a MWE. I can't run anything in your comment and get your exact error message.
Hello Rik.
you were right. I tried to avoid ';' and it worked perfectly.
Thanks for your quick help.
I encountered the same error message. I had sections of query commented with /* ... */ and by removing those it worked again.
Thanks for the tips.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

产品

版本

R2019b

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by