On Mon, 3 Dec 2007 00:49:01 -0600 Larry Garfield <larry@garfieldtech.com> wrote:
As for in-SQL operations on the date value, like MONTH() or YEAR() in MySQL? If someone has an idea for those that doesn't involve regexing every query I would dearly love to hear it. :-)
EXTRACT both in mysql and pg manual. There is not such a beast in MS SQL[*]. Something to get around it in MS SQL could be DATEPART (there is a DATE_PART in mysql and pg if I remember right). Anyway you can't handle all the functions avoiding search&replace. a) we can chose some popular functions to have a good optimisation b) if queries will be built from objects they should be more regular so search&replace could be done without regexp Anyway I really would involve in such decisions people that already did the MS/Oracle/DB2 ports. If we were doing a "general" abstraction layer we could just borrow a more mature one. Unfortunately PHP is not compiled (sort of). [*] as it looks clear... DB abstraction should span more than 2 DB -- Ivan Sergio Borgonovo http://www.webthatworks.it