tcf03 has asked for the wisdom of the Perl Monks concerning the following question:

What Im thinking about is a Perl program that listens on port 1433 ( or some other port ) on an informix ( or some other db ) server and translate the requests into sql that informix understands and respond back with what sql server would respond with. This may not even be worthy of doing - has anyone done this? Or entertained the idea long enough to realize that its a waste of time?

I realize that there are things that I will not be able to translate - I was thinking mostly in terms of queries.

Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

Replies are listed 'Best First'.
Re: database emulation
by Asim (Hermit) on Jun 13, 2006 at 16:32 UTC

    You might want to start with a look-see at DBD::Proxy, which does something similar, allowing you to connect to a DBI session over an TCP connection. There may be some aspect of that which'll work for your goal.

    For full-bore SQL-to-SQL language translations, you might want to start with SQL::Translator. So far as I know, SQL::Translator does not deal with arbitrary SQL commands per se; from my readings on it, its focus is on converting tables from one SQL Type to another. However, I a) could very well be wrong, and b) suspect that the code to do much of what you're looking for is already in the module. Indeed, it even offers a cgi app for doing it's work. The SQL::Translator manual 'plains more.

    Does that help any?

    ----Asim, known to some as Woodrow.