在执行该过程后创建新的表函数。
The new table functions are created after the procedure executes. To list the output columns for the table functions, execute the following statements
创建返回多个值的表函数也不太困难。
Creating a table function that returns multiple values isn't much more difficult.
表函数的调用方法如下。
报告相对于基线数据的差值的包装器表函数。
Wrapper table functions that report deltas relative to the baseline data.
关于样式表函数请参阅本系列的第1部分。
See Part 1 of this series for more about stylesheet functions.
如果不这样做,脚本就无法定义差值表函数要使用的CGTT。
If you do not, the script will be unable to define the CGTTs used by the delta table functions.
清单3显示了用于发现连接到DB2的用户数的表函数。
The table function to find the number of users connected to DB2 is shown in Listing 3.
例如,所有未涉及订购项的步骤都被封装到一个sql表函数中。
For example, all the steps not involving the order lines have been unified into one SQL table function.
函数可以返回单一值(对于标量函数)或多个值(对于表函数)。
The functions can be coded to return a single value (for scalar functions) or multiple values (for table functions).
sql表函数的使用使您可以将过程性逻辑放入到查询的from子句中。
The usage of SQL Table Functions allows you to push procedural logic into the FROM clause of a query.
就像其他的内建函数一样,表函数也可以在SQLselect语句中使用。
Just like any other built-in function, table functions can be used in a SQL SELECT statement.
这个包装器函数的输入值与底层监控表函数相同,所以它也能够筛选返回的数据。
The wrapper function takes as input the same values passed as input to the underlying monitoring table function, so it has the same capability to filter the data that is returned.
系统提供的这三个表函数可以为所有被监视的4种对象类型返回与健康有关的信息。
The three provided table functions can return health-related information for all four monitored object types. These functions are grouped into the following categories.
在图9中,您可以看到我正通过使用视图代替前一图中的表函数,调用相同类型的信息。
In figure 9 you can see that I'm calling the same kind of information by using a view instead of a table function in the previous figure.
TBSCAN(18)表示这个SQL表函数中的RETURN语句。
TBSCAN(18) represents the RETURN statement in the SQL Table function.
与前面的事务一样,这里的大部分逻辑被封装到一个名为PAY_C_LAST的表函数中。
AS in the previous transactions, most of the logic is encapsulated into a table function named PAY_C_LAST .
GENROW表函数会生成在IN 谓词的 <VALUELIST> 中所列的值。
The GENROW table function produces the values listed in the <VALUE LIST> of the IN predicate.
注意,在上面的示例中,使用表函数提取感兴趣的表的数据比搜索快照输出中的数据简单得多。
Notice in the above example how much simpler it is to extract just the data for the table of interest using the table function rather than having to search for the data in the snapshot output.
XMLTABLE是一个sql表函数,它对一个XML文档执行XQuery表达式并返回一个表。
XMLTABLE is a SQL table function that returns a table from the evaluation of XQuery expressions on an XML document.
在清单9所示的查询访问计划中,要注意表employee和一个表函数GENROW间的一个连接。
In the query access plan shown in Listing 9, notice a join between the table EMPLOYEE and a table function, GENROW.
如果发现扩展函数比样式表函数更好,可以定义样式表函数作为扩展函数不能使用时的第二选择。
If you find that an extension function can do a better job than a stylesheet function, then you can define the stylesheet function to be the second choice when the extension function is not available.
使用为基线数据的每会话存储创建的全局临时表(CGTT)(对于每个表函数,使用一个 CGTT)。
Use a created global temporary table (CGTT) for per-session storage of the baseline data (use one CGTT per table function).
DB 2支持许多种数据库服务器端编程语言,包括存储过程、触发器和函数(表函数和标量函数)。
DB2 supports many database server-side programming languages, including stored procedures, triggers, and functions (table and scalar).
如果您连接了一个分区并希望检索另一分区的有效设置,就必须在调用该表函数之前,首先连接这个新分区。
If you are connected to one partition and wish to retrieve the effective Settings for another partition, you must first connect to the new partition before invoking the table function.
通过关联(correlation),SQL表函数允许以一种更高效的方式实现迭代,而不是使用游标。
Through correlation, SQL table functions allow a more efficient way of implementing iterations, otherwise done with cursors.
get_dbm_config表函数在一个有两行记录的表中返回数据库管理器的配置信息,每列代表一个参数。
GET_DBM_CONFIG table function Returns database manager configuration information in a table with two rows and a column for each parameter.
对于不报告计数器值的任何输出列(例如基于状态的输出),包装器直接返回底层监控表函数产生的数据,不做修改。
Any output columns that do not report counter values (for example, state based output) are returned directly from the underlying monitoring table function with no modification by the wrapper.
例如,只需在列出监控表函数返回的应用程序数据的查询中添加where子句,就可以搜索CPU消耗量最大的应用程序。
For example, you can easily search for the applications consuming the highest amount of CPU by simply adding a WHERE clause to a query that lists application data from a monitoring table function.
MON_GET_INDEX表函数和db2pd实用程序提供相同的索引度量指标(扫描索引和仅扫描索引的数量)。
The MON_GET_INDEX table function and db2pd utility provide the same index metrics (number of index scans and index only scans).
本文已经显示了一个过程,您可以使用该过程自动生成表函数,其以关系格式报告以XML文档形式捕获的事件监控器元素。
This article has shown a procedure that you can use to automatically generate table functions that report event monitor elements captured as an XML document in a relational format.
应用推荐