Clive Page wrote:
> On Mon, 2 Feb 2004, Roy Williams wrote:
>
>
>>(1) Is there a "standard" SQL that all the databases understand, somthing >>that is least common denominator, somthing not tied to a vendor? I seem to >>recall SQL92, is that it? Is it ISO or ANSI approved? Is there a definition >>document?
Clearly there needs to be translation from the agreed upon standard to the internal query representation regardless of whether the standard is some particular version of SQL or some XML tree. For those of us with SQL based databases the question arises as to whether it is easier to modify an SQL string to accommodate changes in dialect, or to regenerate the entire SQL string from some preparsed XML.
Just to give a data point here... The HEASARC's Browse service runs on both Oracle and Sybase databases and the answer we have adopted is to use simple regular expression transformations of the query. So for us Sybase SQL is the 'standard' and Oracle is a dialect that we need to translate to.
Function names are relatively easy to isolate since they come immediately before '(' with
no intervening operator. I'm sure that someone could deliberately
craft a query that we'd have trouble
with, but in several years of operation I don't recall it ever happening.
However, we don't support users entering SQL directly.
In practice the only issue we have is in the function to convert a number to a string (convert in Sybase and to_char in Oracle). We used to support Ingres and I believe there were rather more issues there, but there was no problem using the same approach. I see that 11 of the functions you list are identical in all systems and many of the one's that are not are easily mimicked using the standard set (e.g., cot = 1/tan).... So perhaps the glass is half full?
Regards, Tom MCGlynnReceived on 2004-02-02Z20:24:20