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 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
<?xml-stylesheet type="text/xsl" href="dsquery.xsl"?>
21
<html connection="demo" xmlns:xsql="urn:oracle-xsql">
22
<head><title>Query Demo</title></head>
23
<body>
24
<section>Query form</section>
25
<form>
26
  <method>POST</method>
27
  <action>/xmltodb/xsqltest/dsquery.xsql</action>
28
  <textfield>
29
    <name>search_string</name>
30
    <xsql:query tag-case="lower" 
31
                rowset-element="" row-element="" id-attribute="">
32
       select '{@search_string}' AS val FROM DUAL
33
    </xsql:query>
34
  </textfield>
35
  <input type="submit" name="Run query"/>
36
</form>
37
<section>Results</section>
38
<xsql:query tag-case="lower">
39

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