| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: A simple notation, again
Brian Selzer wrote:
[...]
>> You imply order (adjacency) when relation attributes should not be >> subjected to any.... >> >>
I've been playing with Dee (http://www.quicksort.co.uk/) on and off for a while and there it is possible to do it /both/ ways:
http://www.quicksort.co.uk/DeeDoc.html#relations
To assign a relation value to a relation variable, use the standard Python syntax, e.g.
>>> IS_CALLED = Relation(["StudentId", "Name"],
... [{"StudentId":'S1', "Name":'Anne'},
... {"StudentId":'S2', "Name":'Boris'},
... {"StudentId":'S3', "Name":'Cindy'},
... {"StudentId":'S4', "Name":'Devinder'},
... {"StudentId":'S5', "Name":'Boris'},
... ])
[...]
or alteratively, a more concise option is available which relies on the order of the body attributes matching the order of the heading:
>>> IS_CALLED = Relation(["StudentId", "Name"],
... [('S1', 'Anne'),
... ('S2', 'Boris'),
... ('S3', 'Cindy'),
... ('S4', 'Devinder'),
... ('S5', 'Boris'),
... ])
Since I'm a lousy typist I tend to use the latter ;-)
/Lennart Received on Wed Jul 18 2007 - 14:52:32 CDT
![]() |
![]() |