v8.1.4新功能 [英] v8.1.4 new features

查看:97
本文介绍了v8.1.4新功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于那些对新功能感兴趣的人,

建议阅读...

http://publib.boulder.ibm.com/infoce...help/index.jsp

发布信息。

v8.1.4

app.dev.enhencements

sql数据更改操作


从SQL数据更改操作中检索结果集


ex:

SELECT * FROM FINAL TABLE(INSERT ...)

>
您还应该检查包含列页面。

在UPDATE语句中,您可以使用include列返回旧的

和新列值行。


SELECT工资,oldSalary FROM FINAL TABLE

(更新员工INCLUDE(oldSalary decimal(9,2))

SET oldSalary =薪水,薪水=工资* 1.05

WHERE job =''CLERK'')

PM

解决方案

有一个sma将更改CREATE FUNCTION(SQL Scalara,Row,Table):

修改SQL表函数允许SQL数据。

简而言之,您可以执行内联SQL PL一个连接,而不是如果循环很简单,可以用内联SQL来处理游标,而不是
编码游标

PL。它的另一种用法是选择触发器。已被要求

a在这个组中几次。


干杯

Serge


PS:我非常希望听到有关FP4 SQL功能的反馈,

从可用性和性能的角度来看。


-

Serge Rielau

DB2 SQL编译器开发

IBM多伦多实验室


< blockquote> Serge,


是否可以在

''MODIFIES SQL DATA''表格函数中创建一个表(或GLOBAL TEMPORARY)? />

即我们想在UDF中构建一个结果表然后

返回内容。


似乎如果我们在调用UDF

之前预先创建表,那么工作正常,但我们更愿意处理临时数。

UDF中的表格?


谢谢。


Paul。


Serge Rielau< sr ***** @ ca.eye-bee-m.com>在消息新闻中写道:< br ********** @ hanover.torolab.ibm.com> ...

CREATE FUNCTION有一个小变化(SQL Scalara,行,表):
修改SQL表函数允许SQL数据。



不,你不能。在将来有两种攻击角度:

介绍LOCAL临时表。

恕我直言创建和修改LOCAL临时表甚至不计算

作为MODIFIES SQL DATA。

或者介绍DB2 z / Series样式的CREATED GLOBAL临时表。

后者意味着temp在目录中定义(和因此UDF

可以记录对它的依赖)但内容对于会话来说是私有的。


直到任何这些发生,你将需要使用持久表和

使用where子句私有化它,例如generate_unique()。


干杯

Serge


-

Serge Rielau

DB2 SQL编译器开发

IBM多伦多实验室


For those interested in new features,
Suggested reading...

http://publib.boulder.ibm.com/infoce...help/index.jsp
Release info.
v8.1.4
app.dev.enhencements
sql data change operations

Result set retrieval from SQL data-change operations

ex:
SELECT * FROM FINAL TABLE (INSERT ...)

You should also check the include columns page.
In UPDATE statements, you can use include columns to return both the old
and new column values for a row.

SELECT salary, oldSalary FROM FINAL TABLE
(UPDATE employee INCLUDE (oldSalary decimal(9,2))
SET oldSalary = salary, salary = salary * 1.05
WHERE job = ''CLERK'')
PM

解决方案

There is a small change in CREATE FUNCTION (SQL Scalara, Row, Table):
MODIFIES SQL DATA is allowed for SQL Table functions.
In a nutshell you can execute inline SQL PL in a join, rather than
coding a cursor if the loop is simple enough to be handled by inline SQL
PL. Another usage of it are "select triggers" which have been requested
a few times in this group.

Cheers
Serge

PS: I would very much like to hear feedback on the FP4 SQL Features,
both from a usability and performance point of view.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


Serge,

Is it possible to create a table (or GLOBAL TEMPORARY) within a
''MODIFIES SQL DATA'' table funcion?

i.e we would like to build a result table in the UDF and then
return the contents.

It seems to work fine if we pre-create the table before the UDF
is called, but we would prefer to handle the temp. table within the
UDF?

Thanks.

Paul.

Serge Rielau <sr*****@ca.eye-bee-m.com> wrote in message news:<br**********@hanover.torolab.ibm.com>...

There is a small change in CREATE FUNCTION (SQL Scalara, Row, Table):
MODIFIES SQL DATA is allowed for SQL Table functions.



No you can''t. There are two angles of attack on this in some future:
Introduce LOCAL temporary tables.
IMHO creating and modifying a LOCAL temporary table wouldn''t even count
as MODIFIES SQL DATA.
Or introduce DB2 z/Series style CREATED GLOBAL temporary tables.
The latter means the temp is defined in the catalogs (and hence the UDF
can record a dependency on it) but the content is private to teh session.

Until any of these happen you will need to use a persistent table and
privatize it using a where clause and e.g. generate_unique().

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


这篇关于v8.1.4新功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆