Hi,
currently I'm writing a Web application, which should
be able to interface to any SQL database. Using perl this
seems to be straigt forward, mainly due to the DBI module
of Tim Bunce. What makes this task really difficult are
the SQL-dialects of every database. Although SQL is
standardized, there are many, subtle differences which have
to be taken into account. After stripping down my application
to an absolut basic syntax, there is still one problem left.
PostgreSQL understands the following syntax:
select count(SUBSTR(var,1,5)), SUBSTR(var,1,5) from t group by 2;
select count(SUBSTR(var,1,5)) as x, SUBSTR(var,1,5) as y from t group by y;
Unfortunately other databases - like Oracle - are not able to
handle these statements. Oracle understands only the following syntax:
select count(SUBSTR(var,1,5)), SUBSTR(var,1,5) from t group by SUBSTR(var,1,5);
which gives an error with PostgreSQL !
I don't know if any of these variants are standard or non-standard,
but it would be very helpful, if PostgreSQL would be able to
handle all of these examples. From the functional point of view,
there is no difference. I guess, only the parser has to be adapted.
Edmund
--
Edmund Mergl mailto:E.Mergl@bawue.de
Im Haldenhau 9 http://www.bawue.de/~mergl
70565 Stuttgart fon: +49 711 747503
Germany