Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quoting integers

Tags:

sql

I've been under the impression that quoting integers in SQL queries is frowned upon, but I've recently learned that prominent frameworks like Django adheres to this practice. Is it in fact perfectly acceptable?

like image 751
Johannes Gorset Avatar asked Feb 03 '10 17:02

Johannes Gorset


1 Answers

The question implies that you put naked values in your SQL query in the first place. I think the most "acceptable" practice would be to parameterize the query instead - that way you don't have to concern yourself with issues such as this; let the data access library handle it for you instead.

like image 91
Aaronaught Avatar answered Oct 17 '22 00:10

Aaronaught