![]() |
|
|
Published: Wednesday, October 06, 1999
Up until now, we've looked at how to create parent-children data shape relationships. We are restricted, however, to limiting our shapes to parents and immediate children. We can
The syntax for grandchildren is a little complex. What you need to do, is in the child statement, instead of using a child SQL statement, you will use another
Wow, looks a little bewildering, eh? Well, let's look at it in action with the text book example discussed. Here is the table definition for the
Note that each class can have zero to many books assigned. The
We are using data shaping to create TWO children and one grandchild! Isn't this freakin' awesome? Anyway, to loop through the recordsets, we will modify the code we used in Part 2 to include this loop inside of the loop that loops through the
With some sample data entered, this will generate the following output:
Dr. Smith (Phone: 123-4567)
Classes:
Analysis of Algorithms (CS355)
Books:
Algorithmics Explained ($65.95)
Algorithm Theory ($99.95)
Artificial Intelligence (CS341)
Books:
Applied A.I. ($79.50)
Projects:
Self-Documenting Programming
Optimization Routines
Dr. Johnson (Phone: 123-8901)
Classes:
Distributed Systems (CS333)
Books:
None...
Projects:
A.I. In the Workplace
Dr. Mitchell (Phone: 123-1234)
Classes:
Formal Languages & Automata Theory (CS330)
Books:
Automata Theory ($69.95)
A Study of Linguistics ($72.25)
Study of Film (ART85)
Books:
Film History ($39.95)
Software Engineering (CS301)
Books:
Software Engineering Practices ($79.25)
Projects:
Software Reuse Study
Image Processing
Image Recognition
I sure do like data shaping, it is really neat and powerful. The syntax is cool too. :) Not only is data shaping cool, but it is also very useful! Try generating a nice, hierarchical report showing professors, their classes taught (the classes text books), and the research projects worked on by the professors. You would not only have a nasty Hope you learned something new and had fun! Happy Programming!
Attachments:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||