Re: using the same field to be set in the update query and in the where clause
From: Peter H. Coffin <hellsop_at_ninehells.com>
Date: Sun, 12 Mar 2017 13:28:56 -0500
Message-ID: <slrnocb4r8.t3q.hellsop_at_nibelheim.ninehells.com>
Date: Sun, 12 Mar 2017 13:28:56 -0500
Message-ID: <slrnocb4r8.t3q.hellsop_at_nibelheim.ninehells.com>
On Sun, 12 Mar 2017 11:17:29 +0100, Axel Schwenke wrote:
> And since I've seen you using prepared statements all over the place: there
> is no need to prepare each statement or to use a place holder anywhere in a
> query where one fits in. Place holders should only be used in positions
> where the actual value is /variable/. Constants can and should be written
> directly into the query string.
and to underscore this so that it's COMPLETELY CLEAR: building a query on the fly using variable from a host language like Java or PHP is NOT a constant. Those things SHOULD be place-held, prepared, and excuted. ACTUAL constants are things that will not change, like if you're selecting for phone numbers of type='FAX'.
-- "Only Irish coffee provides in a single glass all four essential food groups: alcohol, caffeine, sugar, and fat." -Alex LevineReceived on Sun Mar 12 2017 - 19:28:56 CET
