3 ms·
'SELECT * FROM user WHERE id = ?' OR 'SELECT getUser(?)' presuming you have a stored procedure/function getUser that returns the data you need, and you should (
by james2vegas 17y ago
'SELECT * FROM user WHERE id = ?'
OR
'SELECT getUser(?)' presuming you have a stored procedure/function getUser that returns the data you need, and you should (or a view, at least)
- mattmanser 17y agoSELECT *? A function in the SELECT statment? Oh dear god, a blasphemer! The former can cause performance problems if you have blobs as well as being an unnecessary security hole, the latter can cause performance problems over large datasets as it often forces the execution plan away from a set based solution.
- wlievens 17y agoThe fact that using the most trivial of examples triggers a discussion in on itself helps to prove my point. Nobody debates session.getUser(id)