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

sql in operator #52

Open
zkinyo opened this issue Jan 7, 2016 · 2 comments
Open

sql in operator #52

zkinyo opened this issue Jan 7, 2016 · 2 comments
Labels

Comments

@zkinyo
Copy link

zkinyo commented Jan 7, 2016

Hey David,

Is there a way to use sql in operator in rxjava-jdbc? I would like to use it in a way that enables me to pass a List (or Set) to the builder which substitutes it for my named parameter in the sql string. If it is not possible, what is the best way to use sql in operator? I tried to google it but no result...

Thanks,
Zoltán

@davidmoten
Copy link
Owner

Hi, find jdbc example of this and I'll look at adding it as a feature. Sorry has been so long for response! Excuse my minimal help on this at the moment, much on!

@zkinyo
Copy link
Author

zkinyo commented Mar 31, 2016

No problem, I made a workaround which will be good enough for now.

Example in JDBC:
SELECT my_column FROM my_table WHERE search_column IN (?,?,?)

The problem with this is that you have to insert as many ? as the number of values you want to search for. It would be much better to put one ? and pass a Collection to insert every element of it, but it is not possible with pure JDBC.

You might be able to do it with this library tho if you could replace the ? with concatenated elements of the Collection (adding ' and , where it is necessery).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants