question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Substituting the same variable multiple times into

See original GitHub issue

Given 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
devashishsharma2302commented, May 15, 2018

@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?

0reactions
sripathikrishnancommented, May 27, 2020

Closing this ticket as I believe the underlying issue has long been resolved.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found