“WITH UR”在UDF中 [英] "WITH UR" in a UDF

查看:184
本文介绍了“WITH UR”在UDF中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




为什么不是WITH UR SQL构造在UDF中工作吗?

是否期望从调用SQL设置它?

解决方案

ts******@gmail.com 写道:


为什么不是WITH UR? SQL构造在UDF中工作吗?


是否期望从调用SQL设置它?



WITH UR仅适用于SELECT语句,它应该在UDF中工作。


< blockquote>试试吧。它不起作用。


(说,我在DB21085I Instance上nyemdi02使用64位和DB2

代码版本SQL08023

,其级别标识符为03040106。

信息令牌为DB2 v8.1.0.96,s050811,U803921和U803921。 ,和

FixPak

" 10"

产品安装在< /opt/IBM/db2/V8.1"。



Mark A写道:

ts ****** @ gmail.com 写道:


为什么不是WITH UR SQL构造在UDF中工作吗?


是否期望从调用SQL设置它?



WITH UR仅适用于SELECT语句,它应该在UDF中工作。


隔离和锁定子句的Noe在SQL UDF中工作或触发

,因为内联SQL PL。在CREATE FUNCTION中实际上有一个条款

说明:

无需锁定请求或隐藏隔离级别的内部隔离级别

带锁定请求

指定当函数继承语句的

隔离级别时,锁定请求是否可以与语句的

isolation-clause关联调用该函数。默认

是INHERIT ISOLATION LEVEL,没有锁定请求。

INHERIT ISOLATION LEVEL没有锁定请求

指定,作为函数继承了调用语句的隔离级别,它不能在SQL

语句的上下文中调用,该语句包含一个lock-request-clause作为指定<的一部分br />
isolation-clause(SQLSTATE 42601)。

具有锁定请求的INHERIT隔离级别

指定,因为该函数继承了
调用语句,它还继承了指定的lock-request子句。


如果要控制UDF或TRIGGER中的隔离和锁定,请使用

CALL语句调用一个可以随心所欲的程序。


干杯

Serge


-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室


IOD会议
http://www.ibm.com/software/data/ond...ness/ conf2006 /




Why wouldn''t the "WITH UR" SQL construct work in a UDF?

Is the expectation to set it from the calling SQL?

解决方案

ts******@gmail.com wrote:

Why wouldn''t the "WITH UR" SQL construct work in a UDF?

Is the expectation to set it from the calling SQL?

WITH UR only works for a SELECT statement, and it should work in a UDF.


Try it. It does not work.

(that said, I''m on DB21085I Instance "nyemdi02" uses "64" bits and DB2
code release "SQL08023"
with level identifier "03040106".
Informational tokens are "DB2 v8.1.0.96", "s050811", "U803921", and
FixPak
"10".
Product is installed at "/opt/IBM/db2/V8.1".
)
Mark A wrote:

ts******@gmail.com wrote:

Why wouldn''t the "WITH UR" SQL construct work in a UDF?

Is the expectation to set it from the calling SQL?


WITH UR only works for a SELECT statement, and it should work in a UDF.


Noe of the isolation and locking clauses work in SQL UDF or triggers
because of inline SQL PL. In CREATE FUNCTION there is actually a clause
stating that:
INHERIT ISOLATION LEVEL WITHOUT LOCK REQUEST or INHERIT ISOLATION LEVEL
WITH LOCK REQUEST
Specifies whether or not a lock request can be associated with the
isolation-clause of the statement when the function inherits the
isolation level of the statement that invokes the function. The default
is INHERIT ISOLATION LEVEL WITHOUT LOCK REQUEST.

INHERIT ISOLATION LEVEL WITHOUT LOCK REQUEST
Specifies that, as the function inherits the isolation level of
the invoking statement, it cannot be invoked in the context of an SQL
statement which includes a lock-request-clause as part of a specified
isolation-clause (SQLSTATE 42601).
INHERIT ISOLATION LEVEL WITH LOCK REQUEST
Specifies that, as the function inherits the isolation level of
the invoking statement, it also inherits the specified lock-request-clause.

If you want to control isolation and locking in a UDF or TRIGGER use the
CALL statement to invoke a procedure which can do what it pleases.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/


这篇关于“WITH UR”在UDF中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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