Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

SQL parameters #66

Open dclong opened 7 years ago

dclong commented 7 years ago

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?

escheie commented 7 years ago

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

dclong commented 7 years ago

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.