当前位置: 首页 > 网络学院 > 客户端脚本教程 > APPML > query

APPML
AppML 简介
AppML 案例
AppML 案例说明
AppML 网络服务
案例研究简介
案例研究:数据库
案例研究:AppML
案例研究:HTML 报告
案例研究:HTML 表单
案例研究:目录
案例研究:产品
案例研究:托运人
案例研究:供应商
案例研究:客户
案例研究:雇员
案例研究:应用程序
案例研究:下载
AppML FAQ
AppML 文档
AppML 数据库元素

APPML 中的 query


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 309 ::
收藏到网摘: n/a

The <query> element defines which fields the user can query at runtime.
<query>元素定义了允许用户搜索的字段。

Note: The fields in the <query> element must be presented in the SQL for the report/list.
注意:<query>元素中的字段必须被放置在SQL中。


<query> Child Elements
<query>子元素

The <query> element may have the following child elements:
<query>元素可以包含下面这些子元素:

Element
元素
Description
描述
field Defines the data field that can be queried.
定义可以被查询的数据字段

The default type for the data field is text. If the data field is numeric or is a date field, use the following:
数据字段的默认类型是文本。如果数据字段是数值型或者是日期型,那么可以使用下面这些子句:

<field type="number"> - for a numeric data field [数值型]
<field type="date"> - for a date data field [日期型]

label Defines a label for the query field
为查询字段定义一个标签
operator Defines a query operator
定义一个查询操作符
sql Defines a drop-down box with values to query
定义一个包含查询值参数的下拉框
value Defines a predefined query value
定义一个预定义查询值


Example
案例

A simple query:
一个简单的查询语句:

<?xml version="1.0" ?>
<appml>
<title>CUSTOMERS</title>
<database>
<connection>northwind</connection>
<sql>SELECT Companyname,ContactName,Country
FROM Customers</sql>
</database>
<filters>
<orderby>Companyname</orderby>
<query><field>Companyname</field></query>
<query><field>Country</field></query>
</filters>
<htmlreport />
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

Example
案例

A query with a predefined value:
包含预定值的查询语句:

<?xml version="1.0" ?>
<appml>
<title>CUSTOMERS</title>
<database>
<connection>northwind</connection>
<sql>SELECT Companyname,ContactName,Country
FROM Customers</sql>
</database>
<filters>
<orderby>Companyname</orderby>
<query>
<field>Companyname</field>
<value>F</value>
</query>
<query><field>Country</field></query>
</filters>
<htmlreport />
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

Example
案例

A query with a drop-down box on country:
包含下拉框(国家字段)的查询语句:

<?xml version="1.0" ?>
<appml>
<title>CUSTOMERS</title>
<database>
<connection>northwind</connection>
<sql>SELECT Companyname,ContactName,Country
FROM Customers</sql>
</database>
<filters>
<orderby>Companyname</orderby>
<query><field>Companyname</field></query>
<query>
<field>Country</field>
<sql>SELECT DISTINCT country FROM customers
ORDER BY country</sql>
</query>
</filters>
<htmlreport />
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

评论 (0) All

登陆 | 还没注册?