Since it's introduction in ADO 2.0, data shaping has remained largely
on the fringes of Visual Basic arcanum. Relegated to the back pages of
musty manuals, you may have overlooked this useful aspect of ADO. If
you're not familiar with data-shaping, in essence, it lets you create
recordsets within recordsets--or parent/child relationships--all with a
single ADO object. This means no messy joins, no complicated filtering,
and no need for spaghetti-code in presentation logic. Data shaping
reduces the amount of traffic crossing a network, provides more
flexibility when using aggregate functions, and reduces overhead when
interfacing with leading-edge tools like XML.
To create a shaped recordset, you use a standard SQL statement, along
with three major keywords: SHAPE, APPEND, and RELATE, like so
SHAPE {SELECT EmployeeID,FirstName, LastName
FROM Employees}
APPEND ({SELECT OrderID, shipname, EmployeeID
FROM orders} AS SomeAlias
RELATE EmployeeID TO EmployeeID);
The SHAPE keyword specifies and defines the parent recordset. Once you
create a parent object, you next APPEND the child recordset. This
clause uses a similar syntax as SHAPE and contains the necessary SQL
statement to create the child recordset within the parent. In addition
to the child recordset's SQL statement, you must also indicate how you
want the two recordsets to RELATE.
Data-shaped SQL clauses
By ElementK Journals, published on 14 Jul 2001
| Filed in
You might also like...
SQL forum discussion
-
CorelDRAW VBA: cdrTraceLineDrawing FAILS, producing single linear path instead of Centerline trace?
by dancemanj (0 replies)
-
client/server application using activex
by beautifulheart (0 replies)
-
System Error &H8007007E. The specifed module could not be found.
by swiftsafe (5 replies)
-
Invitation to take part in an academic research study
by researchlab (0 replies)
-
Send SMS with SMPP
by mmahmoud (0 replies)
SQL podcasts
-
webdev radio: SQL Cookbook review, Aardvark, MySQL tuning, CSS question
Published 8 years ago, running time 0h20m
We have the first book giveaway and cover the Aardvark Firefox extension. I also explain some MySQL performance problems I’ve had recently, talk about some MySQL tools which helped me get over those problems, and ask for some help on a CSS layout question. *CSS Creator Layout Generator :: Ge.
SQL jobs
-
Graduate Reports Developer
Jagex in Cambridge, United Kingdom
To £30k (DOE) + Excellent Benefits / Progression -
Data Architect
Integrative Nutrition in New York, United States
Competitive
Comments