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

How to call stored procedure with dynamic arguments? #77

Open
rightaway opened this issue Mar 24, 2018 · 2 comments
Open

How to call stored procedure with dynamic arguments? #77

rightaway opened this issue Mar 24, 2018 · 2 comments

Comments

@rightaway
Copy link

How can I call select * from stored_procedure('arg1', 'arg2', 'arg3') with a dynamic number of args? So I would have an array of arguments like args = ['arg1', 'arg2', 'arg3') that I'd like to pass to the sql-template-string, how can it be done? Could there be something like select * from stored_procedure(${args})?

@felixfbecker
Copy link
Owner

How would you do it without sql template strings?

@rightaway
Copy link
Author

Basically prepare a string with the length of args, like select * from stored_procedure($1, $2, $3), then pass in the args as the other parameter. I wonder if there could be a simpler way that template strings could offer for such purpose.

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