Content-type: text/html; charset=UTF-8
qddb_keylist operation <op> <options> [-exact on|off] <keylist_desc1> <keylist_desc2> qddb_keylist process prune -prunebyattr attr <options> <keylist_desc> qddb_keylist process prune -prunebyrow attrlist <options> <keylist_desc> qddb_keylist process sort|nullop <options> <keylist_desc> qddb_keylist get <keylist_desc> qddb_keylist delete <keylist_desc>|all
<op> is one of intersection|union|exclusion. <options> may be any combination of: -copy on|off -deldup_sameentry on|off -deldup_sameattr on|off
<keylist_desc> is returned by qddb_search(n). It is a token to an internal Qddb data structure that is difficult to deal with under TCL. Each node of a KeyList uniquely describes exactly one tuple and the attribute/instance within that tuple that matched a query.
attr is the name of a valid attribute for the schema. For example, Client.Name.First might be a valid attribute name. attrlist is a list of attributes used to find the elements of the provided keylist.
<options> specify the side effects for the operation. If -copy is on (the default is off), then the result is a copy and the original two keylist arguments are untouched. If -copy is off, then the original two arguments are automatically deleted. "-deldup_sameentry on" deletes any duplicate nodes within the same entry, returning a keylist where each node is a unique tuple in the relation. "-deldup_sameattr on" deletes nodes that match exactly, including the attribute and instance numbers.
-prunebyattr attr -prunebyrow attrlist-prunebyattr prunes the keylist of all nodes not matching the given attribute. -prunebyrow prunes the keylist of all nodes that are not part of a single row containing a match for each attribute in attrlist.
set s [qddb_schema open MyRelation] set k [qddb_search $s regexp {.*aa.*}] set k1 [qddb_keylist process nullop -copy on $k]will copy the keylist described by $k and place a new descriptor in $k1.
$ qddb_tclsh % set s [qddb_schema open FamilyMembers] qddb_schema0 % set k [qddb_search $s word george] qddb_keylist0 % set mylist [qddb_keylist get $k] {5651458 34643 0 1} {7965698 5346 0 1} {2583639 12842 0 1} % set tuple [qddb_tuple read $s [lindex $mylist 0]] qddb_tuple0
A Guide to QDDB Eric H. Herrin II and Raphael A. Finkel Qddb User's Guide An ASCII Database for Fast Queries of Relatively Stable Data Eric H. Herrin II and Raphael A. Finkel Computing Systems, Volume 4 Number 2 University of California Press, Berkeley CA Schema and Tuple Trees: An Intuitive Structure for Representing Relational Data Eric H. Herrin, II and Raphael A. Finkel Computing Systems, Volume 9, Number 2 MIT Press, Cambridge MA TCL and the TK Toolkit John K. Ousterhout Addison-Wesley, 1994 ISBN 0-201-63337-X