问题描述
在WHERE ... LIKE子句中使用连接是无效的吗?
SELECT iam0.g_itemId
来自g2_ItemAttributesMap AS iam0,
g2_ItemAttributesMap AS iam1
WHERE iam1.g_parentSequence LIKE iam0.g_parentSequence || iam0.g_itemId || ''/%''
SQL0440N没有名为||的授权例程类型为功能的找到了
兼容的参数。 SQLSTATE = 42884
环境是DB2 LUW,V8.2.2,Windows XP SP2。
谢谢。
---
--------------------
Larry Menard
" ;鹅的后卫和万物自然
Is it not valid to use concatenation in a WHERE ... LIKE clause?
SELECT iam0.g_itemId
FROM g2_ItemAttributesMap AS iam0,
g2_ItemAttributesMap AS iam1
WHERE iam1.g_parentSequence LIKE iam0.g_parentSequence || iam0.g_itemId || ''/%''
SQL0440N No authorized routine named "||" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884
Environment is DB2 LUW, V8.2.2, Windows XP SP2.
Thanks.
---
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
推荐答案
iam0.g_itemId的数据类型是什么?
What is the data type of iam0.g_itemId?
什么是$ m $ b的数据类型?
What is the data type of iam0.g_itemId?
你不能这样做。 <模式> LIKE运算符的参数非常好
限制 - 它必须是主变量,常量,特殊寄存器,
标量函数结果或任何串联这些。
在你的情况下,你使用两个列值(不允许)和一个字符串
常量(允许)。
-
Matt Emmerton
See:
http://publib.boulder.ibm.com/infoce...n/r0000751.htm
You can''t do this. The <pattern> argument of a LIKE operator is pretty
restrictive -- it must be a host variable, a constant, a special register, a
scalar function result, or a concatenation of any of these.
In your case, you''re using two column values (not allowed) and a string
constant (allowed).
--
Matt Emmerton
iam0.g_itemId的数据类型是什么?
What is the data type of iam0.g_itemId?
你不能这样做。 <模式> LIKE运算符的参数非常有限 - 它必须是主变量,常量,特殊寄存器,标量函数结果或任何这些的串联。 br />
在你的情况下,你使用两个列值(不允许)和一个字符串
常量(允许)。
-
马特Emmerton
See:
http://publib.boulder.ibm.com/infoce...n/r0000751.htm
You can''t do this. The <pattern> argument of a LIKE operator is pretty
restrictive -- it must be a host variable, a constant, a special register,
a
scalar function result, or a concatenation of any of these.
In your case, you''re using two column values (not allowed) and a string
constant (allowed).
--
Matt Emmerton
这篇关于级联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!