Re: Object-oriented SQL statements

From: Zorro <zorabi_at_tx.rr.com>
Date: Tue, 24 Jul 2007 16:09:12 -0700
Message-ID: <1185318552.929361.112240_at_g4g2000hsf.googlegroups.com>


On Jul 24, 4:22 pm, Neo <neo55..._at_hotmail.com> wrote:
> > Please comment on the approach illustrated in :
> >http://www.zhmicro.com/Database.pdf
>
> Let me see if I understand. Z++ allows a C++ program to interact with ?
> ODBC-compatible? databases. It supports DML (not DDL). Thus, it is
> possible to create an object with a set of "records" based on SQL
> statements passed to DB Source.
>
> Suppose I have the following normalized data stored in five tables
> (wigs, coats, colors, textures and material). Since things may have
> different number of attributes and attributes may have more than one
> value, six additional tables may be required to avoid NULLs.
>
> wig1's color is red.
> wig2's color is red, green; texture is soft; material is nylon.
> wig3's texture is soft; material is jute.
>
> coat1's color is red.
> coat2's texture is soft; material is cotton.
> coat3's color is green; texture is smooth, supple.
>
> How would I query for the following:
> 1) Get red wigs.
> 2) Get things whose color is red.
> 3) Get things whose texture is soft
> and material is cotton or nylon.
> 4) How would I access/print all attributes and values for wig2,
> without knowing it's attributes in advance or how many values a
> particular attribute might have?
>
> The following web pages shows how create/query the above example with
> dbd:www.dbfordummies.com/example/ex030.aspwww.dbfordummies.com/example/ex030b.asp

Let me try to say something about your introductory comments, later I will try the example you have mentioned. You may conclude from my reply that the model is not useful, and that is a professional opinion.

There is no compliance with ODBC, or anything else. The intent is to make Z++ SQL statements look very much like those you would type interactively to a DBMS. I am not sure if this is clear, but I will assume it is for now.
You cannot get unknown fields (attributes) with the Z++ setup. The mapping requires that you know all the fields (from all the tables) that you wish to map to members of the class (i.e. the instance of the class). So, this may be a limitation that you would disagree with. The class may have more members, but nothing will be mapped to those members. So, this could be another issue. I do not know what an expert would want to see, although I have asked a few. However, some input like "this is only good when.. or for cases like ..." would be appreciated. The request was to see your views, if you have time to spare.

Thank you very much for your comment.
Regards,

Z. Received on Wed Jul 25 2007 - 01:09:12 CEST

Original text of this message