Teradata/PyTd

SQL parameters

dclong opened this issue · 2 comments

The need to escape $ sign has caused confusions. Why not enforce parameters to be of the form ${param} and drop the need to escape $ sign?

Its a good suggestion. Python Template strings are leveraged for this feature, and that is how it behaves.

I think the template strings causes brings more confusions than convenience. It's common for users to have dollar signs in strings or passwords. The needs to escape $ just make things complicated. I some times run parameterized SQL code in a SQL IDE with parameters manually replaced (for testing purposes). If there are $ signs in the SQL code, then unfortunately I have escape and unescape them every time. I think it's quite easy to implement a customized template for SQL.