Substituting the same variable multiple times into
See original GitHub issueGiven the example query
drop table if exists {{population_table}};
create table {{population_table}} as....;
If I call:
query, bind_params = j.prepare_query(templ, params_dict)
and then
engine.execute(query, bind_params)
I get the error that there aren’t enough bind_params
to substitute into query
. I believe this is because I’ve included the {{population_table}}
variable twice in the template.
How could I go about fixing this? (It might be true that I should execute those queries separately, but it’s also valid to have a case where there are several of the same substitution in one query).
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Key Skill - Substitution with one variable (multiple operations).
" Substitution with one variable ( multiple operations)." ... Key Skill - Use change of base to form a linear formula. DrFrostMaths.
Read more >Inserting the same value multiple times when formatting a string
@Cawas I know this is pretty late, but I like using str.format() . Ex.: query = "SELECT * FROM {named_arg}"; query.format(**kwargs) , where...
Read more >Using Variable Multiple times in one statement — oracle-tech
The problem is that when I execute the statement, The variable subsitution box pops up as many times as the variable shows up...
Read more >Replacing observations appearing multiple times on the same ...
Replacing observations appearing multiple times on the same variable on the same participant. Longitudinal study. - Statalist.
Read more >Excel: find and replace multiple values at once - Ablebits
The formula's logic is very simple: you write a few individual functions to replace an old value with a new one. And then,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@henryrizzi Version 0.1.7 with the change is pushed to PyPi now. Thank you for reporting! @notconfusing Can you upgrade JinjaSQL to version 0.1.7 and check if the issue still persists?
Closing this ticket as I believe the underlying issue has long been resolved.