Converting SQL Dialects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 inlist()
that is used like inlist(X,1,2,3) which converts to the MySQL query "X
IN (1,2,3)". That's easy enough (relatively speaking) but VFP also has
stuff like "EMPTY(X)" where any of Null, the Empty String (for Char),
0000-00-00 (or the VFP equivalent anyways for dates), False (for
Boolean), 0 (for Numeric) are considered empty without needing to
know the data type. So that starts getting a lot more complex since I'd
need to check the data type of the field in the "right" table... to be
able to convert it to something like (X is null OR X="") or (X is null
OR x=0) etc...

These are for customer "stored" queries... I've already manually
converted "system" queries and I'm frustrated to the point of giving
up and adding a column "untested" and let the end user figure it out
but that seems bad from the standpoint of "lazy" and "poor customer
experience".

Thanks!

Matt

P.S. I'm also going to post this to the MySQL general list but my fear
is that they MIGHT say "We only know MySQL so we can't help you with
that other DBMS" I'm hoping that by posting here someone might say
"well it's not to MySQL but I ran script XYZ to convert my VFP to
PostgreSQL..." or similar.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux