GitHub user mergisi added a comment to the discussion: Unable to Parse SQL When 
Using Jinja Templates (Superset 6.0.0.0 + Oracle 19)

Adding to the bot's response - Oracle SQL syntax can be tricky with dynamic 
templates! A few additional tips from my experience:

1. **Oracle-specific quoting**: Oracle uses double quotes for identifiers 
differently than other databases. Your `"StrategyTitle"` and `"Years"` are 
fine, but make sure the generated SQL doesn't have conflicts with reserved 
words.
2. **Debug the rendered SQL**: Before running, try printing/logging the fully 
rendered SQL after Jinja processing. In Superset's SQL Lab, you can sometimes 
see the processed query. This helps identify if the template expansion itself 
is the issue.
3. **Simplified test approach**: Start with a static version of your query (no 
Jinja), confirm it works in Oracle, then add Jinja pieces one at a time:
4.    ```sql
5.    SELECT "StrategyTitle", "Years" FROM "V_STRATEGY_ENTRY" WHERE 1=1 ORDER 
BY "Years"
6.    ```
4. **Alternative**: If you're frequently working with complex SQL queries and 
want to prototype them quickly before adding Jinja logic, tools like 
[ai2sql.io](https://ai2sql.io) can help generate Oracle-compatible SQL from 
natural language descriptions - useful for testing the base query structure 
before templating.
Let us know if you make progress!

GitHub link: 
https://github.com/apache/superset/discussions/37489#discussioncomment-15664151

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to