XML in relational database ? WAS RE: [thelist] worldusa.com sucks
Matt Warden
Matt Warden" <mwarden at odyssey-design.com
Tue Apr 4 15:30:24 2000
Chris,
> I have seen a lot of applications using XML in relational databases. In
any
> cases, it seems to make sense ( as in the example below). But doesn't
this
> kind of defeat the purpose of relational DBs? In Matt's original example,
> what if I wanted to add a feature that gives users who have more than 3
> items a special deal? I can't query the database to get those numbers
> directly, since the data is stored as an XML packet.
If the following variable holds the XML packet:
Dim xmlCart as String 'holds the XML packet
Dim a_xmlItem as Variant
Dim numOfItems as Integer
' you'll have to do this anyway
a_xmlItem = Split(xmlCart, "<item", -1)
numOfItems = UBound(a_xmlItem,1)
IF numOfItems > 2 THEN
' you get a special deal!
END IF
So really, the only added line of code is the definition of a_xmlItem, since
you would still have to use code to test for the number of records in the
CARTITEMS table. I'd argue that it's better this way for the situation you
brought up since we're dealing with strings rather than database recordsets.
--
Matt Warden
http://mattwarden.com
me AT mattwarden DOT com