- let query =
- let pos_predicate =
- String.concat " OR "
- (List.map (fun pos -> sprintf "(h_position = \"%s\")" pos) positions)
- in
- sprintf ("SELECT h_occurrence FROM %s WHERE source=\"%s\" AND (%s) UNION "^^
- "SELECT h_occurrence FROM %s WHERE source=\"%s\" AND (%s)")
- (MetadataTypes.obj_tbl ()) uri pos_predicate
- MetadataTypes.library_obj_tbl uri pos_predicate
-
+ let pos_predicate =
+ String.concat " OR "
+ (List.map (fun pos -> sprintf "(h_position = \"%s\")" pos) positions)
+ in
+ let query tbl =
+ sprintf "SELECT h_occurrence FROM %s WHERE source=\"%s\" AND (%s)"
+ tbl uri pos_predicate
+ in
+ let db = [
+ HSql.Library, MetadataTypes.library_obj_tbl;
+ HSql.Legacy, MetadataTypes.library_obj_tbl;
+ HSql.User, MetadataTypes.obj_tbl ()]