New ask Hacker News story: Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?

Ask HN: Is there is an sqlite3_expanded_SQL()'s equivalent for other DBMS?
3 by lfconsult | 1 comments on Hacker News.
Hi HN, I'm digging around in order to find a way to get back the SQL statement from a compiled statement with bound parameters (avoid SQLi) for others DBMS. I've found - with excitements- that the SQLite C interface have a sqlite3_expanded_sql()* function to get exactly what I needed. As I didn't found anything for SQLServer, I thought - at first - that it was just not possible at all because the SQL statement and parameters were sent separately (or, kind of, maybe the same compiled blob but without any chance to building back the raw SQL statement). For example, the raw SQL statement is : SELECT * FROM Genre WHERE Name = ? The bound parameter is : "Pop" I would like to get back : SELECT * FROM Genre WHERE Name = 'Pop' Maybe it's a profane question but I did spend a lot of time around in order to find what I need. If you ever wonder why I'm asking this question, just for curiosity. In order to know if it's not even thinkable, doable, or just no implemented yet or if it depends of the DBMS or 42. * https://ift.tt/qVKcuQt

Comments

Popular posts from this blog

New ask Hacker News story: Tell HN: Equifax free credit report dark patterns

New ask Hacker News story: Ask HN: Why can't the US government run their own social media?