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

sql2csv: Support for bind parameters #1048

Open
cfh294 opened this issue Nov 19, 2019 · 1 comment
Open

sql2csv: Support for bind parameters #1048

cfh294 opened this issue Nov 19, 2019 · 1 comment

Comments

@cfh294
Copy link

cfh294 commented Nov 19, 2019

It would be great to be able to pass in bind parameters for parameterized queries when using sql2csv. Something along the lines of:

query.sql

select * from phone_book where last_name=:p_last_name;

Script:

sql2csv query.sql -b "p_last_name='Jones'" --db <connection string>
@IdrissaD
Copy link

IdrissaD commented Jun 22, 2021

It seems like it can be done that way, it worked for me:

CATEGORIES=(table1 table2 table3)

for i in "${CATEGORIES[@]}"
do
   :
   sql2csv --db <connection string> --query "SELECT * FROM v_${i}" > csv/$i
done

Not exactly the same process but maybe it'll help someone else.

@jpmckinney jpmckinney changed the title Support for bind parameters for sql2csv sql2csv: Support for bind parameters Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants