Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDB Connector: SQL parser doesn't recognize parameters for LIKE #698
Comments
Stefan365
added
the
cat/bug
label
Dec 11, 2017
KurtStam
changed the title from
datamapper SQL parser doesn't recognize parameters for LIKE
to
Database SQL parser doesn't recognize parameters for LIKE
Dec 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
Dec 14, 2017
Contributor
I think you got an error? This error should have been shown at the action configuration time (see also #718). So it's nothing to do with the datamapper, but with the DB connector parser instead. That said, will try to fix it.
|
I think you got an error? This error should have been shown at the action configuration time (see also #718). So it's nothing to do with the datamapper, but with the DB connector parser instead. That said, will try to fix it. |
KurtStam
self-assigned this
Dec 14, 2017
KurtStam
changed the title from
Database SQL parser doesn't recognize parameters for LIKE
to
DB Connector SQL parser doesn't recognize parameters for LIKE
Dec 14, 2017
KurtStam
changed the title from
DB Connector SQL parser doesn't recognize parameters for LIKE
to
DB Connector: SQL parser doesn't recognize parameters for LIKE
Dec 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
commented
Dec 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
Dec 14, 2017
Contributor
@Stefan365 When fixing this I think your second example is slightly wrong as I think the % sign needs to be part of the input param itself. So as you state in your first example it should be able to handle:
DELETE FROM TODO WHERE task LIKE ':#task'
where the task param value can be set to 'Joe%'.
|
@Stefan365 When fixing this I think your second example is slightly wrong as I think the % sign needs to be part of the input param itself. So as you state in your first example it should be able to handle:
where the task param value can be set to 'Joe%'. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
Dec 14, 2017
Contributor
@Stefan365 as far as your datamapper screenshots, you can only get at the moment because of #718. So now you arrive at the datamapper with an invalid dataShape. You can verify the error in your javascript console when saving the action config (but bc of #718, it keeps going)
|
@Stefan365 as far as your datamapper screenshots, you can only get at the moment because of #718. So now you arrive at the datamapper with an invalid dataShape. You can verify the error in your javascript console when saving the action config (but bc of #718, it keeps going) |
added a commit
to KurtStam/syndesis
that referenced
this issue
Dec 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
Dec 14, 2017
@KurtStam this is my result with
DELETE FROM TODO WHERE task LIKE ':#task'
(see picture)
It is not clear to me how to infiltrate '%' in input parameter.

e.g. you want to delete all todos which tasks contains first_name (from Contact). how do you proceed?
Stefan365
commented
Dec 14, 2017
|
@KurtStam this is my result with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
Dec 14, 2017
Contributor
@Stefan365 Like I said before the inputDataShape was calculated incorrectly. This is what my commit fixes. So with that fix you should be able to issue exactly what you did:
DELETE FROM TODO WHERE task LIKE ':#task'
where you can make task to firstName. I think in the datamapper you maybe able to enhance that value to concatenate it with % signs. I think you can use a padStringLeft and padStringRight in the datamapper. You cannot do it in the query.
|
@Stefan365 Like I said before the inputDataShape was calculated incorrectly. This is what my commit fixes. So with that fix you should be able to issue exactly what you did: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Please reopen if this is still an issue for you. |
KurtStam
closed this
Jan 2, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
May 13, 2018
hi @KurtStam ,
I see this behavior again.
if I put e.g. DELETE FROM TODO WHERE task LIKE ':#task' as target connection action.
I don't have option to add Data Mapper step, since ':#task' is not visible for DM. If I change it to :#task, parameter is recognized as should be.
Checked on CR1(see https://gist.github.com/dsimansk/b839cbd39e553ec4680bcd8a3b47c3ff) and Syndesis master branch.
Stefan365
commented
May 13, 2018
|
hi @KurtStam , Checked on CR1(see https://gist.github.com/dsimansk/b839cbd39e553ec4680bcd8a3b47c3ff) and Syndesis master branch. |
Stefan365
reopened this
May 13, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
May 13, 2018
@KurtStam one more thing,
IMHO If I look at ... LIKE '%:#param'... vs. ... LIKE ':#param' + padStringLeft '%' in datamapper
I'm finding first option more user friendly than the second one (as a user how should I know, there is some 'padStringLeft' option in DM? moreover if I'm familiar with SQL regex)
Is there any possibility to allow " '%:#param' syntax" in the future?
Stefan365
commented
May 13, 2018
|
@KurtStam one more thing, Is there any possibility to allow " '%:#param' syntax" in the future? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
May 15, 2018
Contributor
@Stefan365 You're right, I mistyped above, there are not supposed to be any quotes.
At the moment finding a parameter relies on the fact that it starts with :#. So if we use a prefix % we're mixing a variable name with SQL syntax. Not sure Camel itself even supports that. That said I'm sure we can sort of 'preprocess' the statement if we really want to support it, but it's not that easy.
|
@Stefan365 You're right, I mistyped above, there are not supposed to be any quotes. At the moment finding a parameter relies on the fact that it starts with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
May 16, 2018
@KurtStam In that case (no quotes only) LIKE cannot be used at all.
Just one question, did it never work? I'm quite sure it worked (LIKE ':#param') for some time period.
Stefan365
commented
May 16, 2018
|
@KurtStam In that case (no quotes only) LIKE cannot be used at all. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
May 16, 2018
Contributor
@Stefan365 I added this test back then:
and it's tested with Oracle, Postgresql, Mysql and Derby.
|
@Stefan365 I added this test back then: and it's tested with Oracle, Postgresql, Mysql and Derby. |
heiko-braun
added this to Backlog
in Bug Backlog
Jun 23, 2018
heiko-braun
added this to Backlog
in QE issues
Jul 16, 2018
heiko-braun
added
the
source/qe
label
Jul 16, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
KurtStam
Oct 8, 2018
Contributor
@Stefan365 I would say that if the Camel SQL component starts supporting it, then we should add support for it too. Can you open a ticket with the Camel project?
|
@Stefan365 I would say that if the Camel SQL component starts supporting it, then we should add support for it too. Can you open a ticket with the Camel project? |
KurtStam
closed this
Oct 8, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Stefan365
Oct 8, 2018
hi @KurtStam since July I don't work for RedHat, contact please someone else from syndesis-qe team.
Stefan365
commented
Oct 8, 2018
|
hi @KurtStam since July I don't work for RedHat, contact please someone else from syndesis-qe team. |


Stefan365 commentedDec 11, 2017
e.g.
this is ok:
but datamapper cannot recognize these parameters: