
Hi *,
judging from the problems arising with only three databases (mysql,
postgesql and sapdb), I think there is no way to provide a single
statement that fulfills the requirements of all databases.
IMO there are two ways to solve the problem:
Provide for each statement different versions for each db and implement
something like gettext for sql. Then you can define a db and the software
automagically uses the correct sql syntax.
The other way would be to create data type definition schemes for
each database. In the functions you would use no sql any more, but
abstract commands that will be interpreted by some kind of sql parser,
that would translate the abstract command into correct SQL for the
specific database.
I am not quite sure wich of these solutions will be the best, maybe
you have opinions about it or other ideas.
Quoting Wolfgang Rosenauer
It works if AS is avoided and this shouldn't break the sense of the statement?
The reference manual is for SAPDB 7.4. I'm using 7.3.0.29. Perhaps this could be a problem, but I don't think so. AS is working in SELECT bla AS blub but not behind FROM or WHERE.
I found some other problems after fixing those:
- you use "SELECT count(*) AS count" but count is a reserved identifier within SAPDB - LIMIT [n] is not possible in SAPDB and is a proprietary PostgreSQL and MySQL addon IMHO
CU, Wolfgang
cu, Sibbi -- You can observe a lot by just watching.