On Sun, 2003-07-13 at 05:24, Antonios Christofides wrote:
> Hi, this is a general RDBMS question, not specific to pg. It occurred to
> me while I was trying to design an interface between application and
> SQL.
[snip]
>
> It seems complex at first, but the code will be cleaner, scale better,
> and be made portable easier if you are adding nodes and leaves to a tree
> as you are scanning the user's input, than if you try to construct a
> where clause directly. After finishing with the tree, it is
> straightforward to convert it to a where clause, after which you send
> the SQL to the RDBMS.
>
> What will the RDBMS do next? It will parse your SQL statement and
> presumably convert it to a tree of conditions. Well, I had that ready in
> the first place!
>
> Whether my idea about the tree is good or not, it is true that the
> application initially has its data in some data structures suitable for
> computers rather than humans; it converts them to SQL, which is suitable
> for humans, only so that the SQL will be converted back to structures
> suitable for computers. The most obvious example is that integers are
> converted to decimal by the application only to be converted back to
> binary by the RDBMS.
When Oracle bought Rdb from Digital, it got DSRI, the Digital
Standard Relatonal Interface. A direct API into Rdb. No one
uses it, though. Why? It's too complicated.
> I understand that SQL is the interface between apps and RDBMS's because
> of history, not because it is correct design. Could you point me to a
> link or book or paper that deals with this paradox? Thanks!
Who says SQL's design is incorrect? SQL became the de facto
standard because it was better than the competing relational
interface languages, not because of Borg-like tactics.
--
+-----------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@cox.net |
| Jefferson, LA USA http://members.cox.net/ron.l.johnson |
| |
| 4 degrees from Vladimir Putin
+-----------------------------------------------------------+