外联盟 [英] OUTER UNION

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

问题描述

你好,


在查看一个似乎使

数据库处于压力之下的特定SQL语句时,我发现以下构造是新的

me:


SELECT ...

FROM ...

OUTER UNION

SELECT ...

FROM ...


该语句见于动态SQL语句文本中。 GET

SNAPSHOT FOR APPLICATION的一部分。换句话说:构造被

DB2接受。 OUTER UNION似乎不是SQL标准的一部分,我不能在DB2的文档中找到它的文档。这是一个文件

缺陷,还是仅仅是我在搜索文档时不够好?


(该声明来自于SAS脚本,可能是SASproc

sql部分的一部分.OUTER UNION在SAS''docs中有记录。我想确保SAS和DB2确定

同意发生了什么。)


-

问候,

Troels Arvin< tr *** *@arvin.dk>
http://troels.arvin.dk/

Hello,

While looking into a particular SQL statement which seemed to put the
database under pressure, I found the following construct which is new to
me:

SELECT ...
FROM ...
OUTER UNION
SELECT ...
FROM ...

The statement was seen in the "Dynamic SQL statement text" part of "GET
SNAPSHOT FOR APPLICATION". In other words: The construct was accepted by
DB2. OUTER UNION doesn''t seem to part of the SQL standard, and I can''t
find documentation for it in DB2''s documentation. Is this a documentation
defect, or is it simply me who''s not good enough at searching the docs?

(The statement was issued from a SAS script, probably part of a SAS "proc
sql" section. OUTER UNION is documented in SAS'' docs. I want to make sure
that SAS and DB2 agree on what''s going on.)

--
Regards,
Troels Arvin <tr****@arvin.dk>
http://troels.arvin.dk/

推荐答案

Troels Arvin写道:
Troels Arvin wrote:

你好,


在查看一个似乎使

数据库处于压力之下的特定SQL语句时,我发现以下构造对于

我是新的:


SELECT ...

FROM ...

OUTER UNION

SELECT .. 。

FROM ...


该语句见于动态SQL语句文本中。 GET

SNAPSHOT FOR APPLICATION的一部分。换句话说:构造被

DB2接受。 OUTER UNION似乎不是SQL标准的一部分,我不能在DB2的文档中找到它的文档。这是一个文件

缺陷,还是仅仅是我在搜索文档时不够好?


(该声明来自于SAS脚本,可能是SASproc

sql部分的一部分.OUTER UNION在SAS''docs中有记录。我想确保SAS和DB2确定

同意发生了什么。)
Hello,

While looking into a particular SQL statement which seemed to put the
database under pressure, I found the following construct which is new to
me:

SELECT ...
FROM ...
OUTER UNION
SELECT ...
FROM ...

The statement was seen in the "Dynamic SQL statement text" part of "GET
SNAPSHOT FOR APPLICATION". In other words: The construct was accepted by
DB2. OUTER UNION doesn''t seem to part of the SQL standard, and I can''t
find documentation for it in DB2''s documentation. Is this a documentation
defect, or is it simply me who''s not good enough at searching the docs?

(The statement was issued from a SAS script, probably part of a SAS "proc
sql" section. OUTER UNION is documented in SAS'' docs. I want to make sure
that SAS and DB2 agree on what''s going on.)



db2 =连接到测试;


数据库连接信息

数据库服务器= DB2 / NT 9.X.0

SQL授权ID = SRIELAU

本地数据库别名= TEST


db2 =值1外部联合值1;

SQL0104N意外的令牌外部在值1之后被发现。

预期的令牌可能包括:< space>。 SQLSTATE = 42601

db2 =值1联合值1;


1

---------- -

1


已选择1条记录。

您使用的是哪个平台?我从来没听说过。会是什么?

语义?


干杯

Serge

- < br $>
Serge Rielau

DB2解决方案开发

IBM多伦多实验室

db2 =connect to test;

Database Connection Information

Database server = DB2/NT 9.X.0
SQL authorization ID = SRIELAU
Local database alias = TEST

db2 =values 1 outer union values 1;
SQL0104N An unexpected token "outer" was found following "values 1 ".
Expected tokens may include: "<space>". SQLSTATE=42601
db2 =values 1 union values 1;

1
-----------
1

1 record(s) selected.
Which platform are you on? I have never heard of it. What would be it''s
semantics?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


Serge Rielau写道:
Serge Rielau wrote:

db2 = values 1 outer union values 1; SQL0104N一个意外的令牌

" outer"在值1之后发现。预期的代币可能包括:

"< space>"。 SQLSTATE = 42601 db2 =值1个联合值1;


1

-----------

1


已选择1条记录。


您使用的是哪个平台?
db2 =values 1 outer union values 1; SQL0104N An unexpected token
"outer" was found following "values 1 ". Expected tokens may include:
"<space>". SQLSTATE=42601 db2 =values 1 union values 1;

1
-----------
1

1 record(s) selected.
Which platform are you on?



AIX上的DB2 v.8和Linux上的DB2 v.9.5。在这些平台上,您的测试

与VALUES ... VALUES也会导致错误。但如果我使用真正的测试

表,外部联盟被接受了。似乎DB2只是忽略了外部

字。

DB2 v. 8 on AIX and DB2 v. 9.5 on Linux. On these platforms, your test
with VALUES ... VALUES also results in an error. But if I use real test
tables, "outer union" is accepted. It seems DB2 simply ignores the "outer"
word.


我从未听说过它。什么是它的语义?
I have never heard of it. What would be it''s semantics?

http://v8doc.sas。 com / sashtml / proc / zueryexp.htm 有一些例子。如果

我对SAS''docs的阅读是正确的,那么SAS''OUTER UNION的语义就是

肯定不会忽略OUTER这个词。对于这个问题,SAS肯定很奇怪(因为它与其他主题一样),但DB2也是如此:为什么

不抗议?


-

问候,

Troels Arvin< tr **** @ arvin.dk>
http://troels.arvin.dk/

http://v8doc.sas.com/sashtml/proc/zueryexp.htm has some examples of it. If
my reading of SAS'' docs is right, the semantics of SAS'' OUTER UNION is
certainly not to simply ignore the OUTER word. SAS is surely being strange
regarding this (as it is with heaps of other subjects), but so is DB2: Why
doesn''t it protest?

--
Regards,
Troels Arvin <tr****@arvin.dk>
http://troels.arvin.dk/


Troels Arvin写道:
Troels Arvin wrote:

Serge Rielau写道:
Serge Rielau wrote:

> db2 = values 1 outer联合价值1; SQL0104N意外的令牌
外部在值1之后发现。预期的代币可能包括:
< space>。 SQLSTATE = 42601 db2 =值1联合值1;

1
-----------
1

1条记录(s)已选择。

您使用的是哪个平台?
>db2 =values 1 outer union values 1; SQL0104N An unexpected token
"outer" was found following "values 1 ". Expected tokens may include:
"<space>". SQLSTATE=42601 db2 =values 1 union values 1;

1
-----------
1

1 record(s) selected.
Which platform are you on?



AIX上的DB2 v.8和Linux上的DB2 v.9.5。在这些平台上,您的测试

与VALUES ... VALUES也会导致错误。但如果我使用真正的测试

表,外部联盟被接受了。似乎DB2只是忽略了外部

这个词。


DB2 v. 8 on AIX and DB2 v. 9.5 on Linux. On these platforms, your test
with VALUES ... VALUES also results in an error. But if I use real test
tables, "outer union" is accepted. It seems DB2 simply ignores the "outer"
word.


>我从未听说过它。什么是它的语义?
>I have never heard of it. What would be it''s semantics?


http:// v8doc.sas.com/sashtml/proc/zueryexp.htm 有一些例子。如果

我对SAS''docs的阅读是正确的,那么SAS''OUTER UNION的语义就是

肯定不会忽略OUTER这个词。对于这个问题,SAS肯定很奇怪(因为它与其他主题一样),但DB2也是如此:为什么

不抗议?


http://v8doc.sas.com/sashtml/proc/zueryexp.htm has some examples of it. If
my reading of SAS'' docs is right, the semantics of SAS'' OUTER UNION is
certainly not to simply ignore the OUTER word. SAS is surely being strange
regarding this (as it is with heaps of other subjects), but so is DB2: Why
doesn''t it protest?



哦!,哦!


SELECT outer.c1 FROM T OUTER UNION VALUES 1;


:-)

干杯

Serge


-

Serge Rielau

DB2解决方案开发

IBM多伦多实验室

Oh!, Ohh!

SELECT outer.c1 FROM T OUTER UNION VALUES 1;

:-)

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


这篇关于外联盟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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