Re: Object-oriented SQL statements
Date: Tue, 24 Jul 2007 14:22:14 -0700
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
www.dbfordummies.com/example/ex030b.asp Received on Tue Jul 24 2007 - 23:22:14 CEST