Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 3:39 PM, Matt Neimeyer wrote: >> You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. >> MySQL seems to be pretty forgiving with its implicit type-casting. > > Hmm... The new system I've written properly handles the datatype and > EMPTY... So this would be a h

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Matt Neimeyer
> You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. > MySQL seems to be pretty forgiving with its implicit type-casting. Hmm... The new system I've written properly handles the datatype and EMPTY... So this would be a hack to much around with regexs to replace EMPTY in customer b

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Paul M Foster
On Tue, Jul 21, 2009 at 06:54:35PM +0100, Ashley Sheridan wrote: > On Tue, 2009-07-21 at 13:46 -0400, Matt Neimeyer wrote: > > Has anyone come across / written a script that will convert one > > "flavor" or Dialect of SQL to another? > > > > I need to convert Visual FoxPro 6.0 style WHERE clauses

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Andrew Ballard
On Tue, Jul 21, 2009 at 2:13 PM, Matt Neimeyer wrote: > Um... It depends? :) These are customer entered queries and vary based > on the end user and the customizations they have. It could be as > simple as WHERE inlist(SalesPerson,"Bob","Bill","Fred") OR it could be > something 12 lines long that p

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Matt Neimeyer
Um... It depends? :) These are customer entered queries and vary based on the end user and the customizations they have. It could be as simple as WHERE inlist(SalesPerson,"Bob","Bill","Fred") OR it could be something 12 lines long that pulls in criteria from multiple tables each of those with their

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Ashley Sheridan
On Tue, 2009-07-21 at 13:46 -0400, Matt Neimeyer wrote: > Has anyone come across / written a script that will convert one > "flavor" or Dialect of SQL to another? > > I need to convert Visual FoxPro 6.0 style WHERE clauses to MySQL. > > For the most part the problems are converting VFP functions

[PHP] Converting SQL Dialects

2009-07-21 Thread Matt Neimeyer
Has anyone come across / written a script that will convert one "flavor" or Dialect of SQL to another? I need to convert Visual FoxPro 6.0 style WHERE clauses to MySQL. For the most part the problems are converting VFP functions to the equivalent SQL. For example, Visual FoxPro has a function inl