Tell Me Glossary
 

Master-Detail Queries - with Multiple Attribute Values

Previous previous|next Next Page

SES supports documents with attributes that have multiple values.

  • User can specify a separate query for each attribute of the document that has multiple values.
  • The query should select a single column corresponding to the attribute and the 'where' clause of this query should have bind variables of the form ##PARENT ATTR## in which appropriate value of the parent record will be substituted while executing the query.
  • The name of the attribute to be added to the document will be the name specified in the SELECT clause.
    • If the documents in the result set of the document query have multiple authors, then a separate query can be specified to retrieve the authors of every document.
    • Consider this example:
      SELECT
      A.AUTH AUTHOR
      FROM
      DOCTABLE DOC, DOC_AUTHOR A
      WHERE
      A.DOCID=##DOCID##

    • For every parent document, the value of attribute DOCID will be substituted to retrieve the authors of the document.
    • All the names will be added as values of the attribute AUTHOR of the parent document.
    • AUTHOR is the alias to the column A.AUTH.
      • If AUTHOR was not specified as an alias, the names of authors will be added as values of the attribute AUTH of the parent document.
    • The user can specify any number of attribute queries.
    • The records fetched by each of the attribute queries corresponding to the parent record will be added as values of the corresponding attributes of the document represented by the parent record.
  • The columns specified by the detail queries can be any of the following data types:
    1. VARCHAR2
    2. Date types - DATE, TIMESTAMP
    3. Numeric types - INTEGER, DECIMAL, NUMERIC, SMALLINT, TINYINT