Re: Call for an API standard for SQL statements

From: Alfredo Novoa <alfredo_at_ncs.es>
Date: Fri, 22 Oct 2004 11:22:23 GMT
Message-ID: <4178ed65.92046406_at_news.wanadoo.es>


On 21 Oct 2004 09:42:00 -0700, fredrik_bertilsson_at_passagen.se (Fredrik Bertilsson) wrote:

>One feature I use is that I want custom datatypes. Lets say I have a
>table column for telephone numers. In the database it is just a
>VARCHAR, but in my application I handle this value as an instance of
>the class TelephoneNo. Immediately after reading my framework converts
>the string to an instance of TelephoneNo. To be able to do this I have
>associated this column with the class TelephoneNo in a configuration
>object.

You can do the same with a text parser associating the class with an SQL "domain".

>A second extremly useful feature is converting a two-dimensional query
>result into a hierachical view. Lets say that we have a query joinin
>the tables "Order" and "OrderDetail". My framework returns a list of
>"Order" records, but calling the method "getRelatedRecords" on such
>instance, will return a list of "OrderDetail" records. This feature is
>only possible if the framework has knowledge about wich tables are
>participating in the query.

You only need to know which are the "master" and "detail" columns.

>A third example is data-aware GUI components. Lets say we want to make
>a search panel which takes a query object, builds a GUI and let the
>user fill in the parameters. This is of course only possible if we
>have have a query object.

We can do the same parsing an SQL text statement.

>Finally, maybe the most important feature of all. Database vendor
>indepence. Unfortunately the most popular databases have small syntax
>differences in their SQL language. Using object representation of SQL
>statements is a very easy way to build the correct SQL string for the
>target database.

We can use ANSI SQL or your own SQL dialect and to translate it to any other SQL dialect.

Regards Received on Fri Oct 22 2004 - 13:22:23 CEST

Original text of this message