Project

General

Profile

1
<?xml version = '1.0'?>
2
<!--
3
  * dsquery.xsql
4
  *
5
  *      Authors: Matt Jones
6
  *    Copyright: 2000 Regents of the University of California and the
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *      Created: 2000 April 5
10
  *      Version: 0.01
11
  *    File Info: '$Id: dsquery-xsql.xml 36 2000-04-13 16:56:11Z jones $'
12
  * 
13
  * This is an XSQL (http://technet.oracle.com/tech/xml) document designed
14
  * to query a relational database and return the result as a well-formed
15
  * XML document. The query is a general search for datasets that match
16
  * search criteria from a metadata catalog containing documents that are 
17
  * valid with respect to the eml-dataset.dtd module of the Ecological 
18
  * Metadata Language (EML)
19
-->
20
<html connection="demo" xmlns:xsql="urn:oracle-xsql">
21
<head><title>Query Demo</title></head>
22
<body>
23
<section>Query form</section>
24
<form>
25
  <method>POST</method>
26
  <action>/xmltodb/xsqltest/dsquery.xsql</action>
27
  <textfield>
28
    <name>search_string</name>
29
    <xsql:query tag-case="lower" 
30
                rowset-element="" row-element="" id-attribute="">
31
       select '{@search_string}' AS val FROM DUAL
32
    </xsql:query>
33
  </textfield>
34
  <input type="submit" name="Run query"/>
35
</form>
36
<section>Results</section>
37
<xsql:query tag-case="lower">
38

    
39
  SELECT meta_file_id,dataset_id,title, 
40
         CURSOR (SELECT salutation,given_name,surname
41
                   FROM party_individual pi
42
                  WHERE pi.party_individual_id IN
43
                        (SELECT party_individual_id FROM party p
44
                          WHERE p.meta_file_id = ds.meta_file_id)) as originators 
45
    FROM eml_dataset ds
46
   WHERE UPPER(meta_file_id) LIKE UPPER('%{@search_string}%')
47
      OR UPPER(dataset_id)  LIKE UPPER('%{@search_string}%')
48
      OR UPPER(title)  LIKE UPPER('%{@search_string}%')
49
      OR UPPER(abstract) LIKE UPPER('%{@search_string}%')
50
</xsql:query>
51
</body>
52
</html>
(2-2/20)