Re: sprintf versus straight entry



Hugh Oxford wrote:
FutureShock wrote:
Are there advantages to using sprintf for building DB queries versus direct building?

Thanks
Scotty

Personally I use sprintf for just about everything. I find it makes everything far more legible. You can put sql queries inside single quoted strings and then use double quotes within it.

Some people might say there is a performance overhead, but if my performance issues were simply down to this kind of thing I would be grateful.

My experience also..the database enquiry is probably 10-1000 times slower than generating the query..
.