从光标加载联合(信息集成器) - Oracle日期问题 [英] Federated (information integrator) load from cursor - Oracle date problem

查看:59
本文介绍了从光标加载联合(信息集成器) - Oracle日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好;

我们有许多生产工作,从光标加载从源表中驻留Oracle 9i的UDB / AIX 8.2
Oracle日期(大致)等于DB2时间戳,我们经常使用date()函数来转换。从DB2 date数据类型到DB2 date数据类型


我们已经在20多个Oracle表中使用了这种技术几个月

没问题。特别是一个表失败,sqlcode为-180

(db2日期值无效)。有谁为什么我们可能会看到这个?

可能是Oracle支持的日期超出了db2支持
的范围吗?任何帮助赞赏。下面的工作输出......


Pete H

---------------------- ---------------------------

声明fedcurs游标为

选择项目

,loc

,constrstocklowqty

,日期(constrstocklowdate)

,constrstocklowdur

,constrstocklowqty

,日期(constrstockoutdate)

,constrstockoutdur

,maxconstrcovdur

,日期(maxconstrcovdate)

来自fdr.manu_skustatstatic

其中item不喜欢''ITC%''

和项目不喜欢''RM%''

和项目不喜欢''PGM%''

和项目不喜欢''IGP%''

和项目不喜欢''ITM%''

;

SQLCODE是:0

sqlcaid:SQLCA sqlcabc:136 sqlcode:0 sqlerrml:0

sqlerrmc:

sqlerrp:SQL08023

sqlerrd:(1)0(2)0(3)511397

(4)180107 (5)0 (6)1

sqlwarn:(1)(2)(3)(4)(5)(6)

(7)(8)(9)( 10)(11)

sqlstate:00000

SQL stmt是:

来自fedcurs of cursor warningcount 2

消息/xxxx/prod/syslog/irw147.2006-06-05-02:55:08/irw147.loadmsgs

替换为STAGE.manu_skustatstatic

数据缓冲区600

redirect_part_output

/xxxx/prod/syslog/irw147.2006-06-05-02:55:08/load.log

;

SQLCODE是:-180

sqlcaid:SQLCA sqlcabc:136 sqlcode:-180 sqlerrml:0

sqlerrmc:

sqlerrp:SQLSNERR

sqlerrd:(1)0(2)0(3)0

(4)0(5)0(6) 0

sqlwarn:(1)(2)(3)(4)(5)(6)

(7)(8)(9)(10)( 11)

sqlstate:22007

解决案
peteh写道:
大家好;
我们有许多生产作业即"从光标"负载;从源表中驻留Oracle 9i到UDB / AIX 8.2
(带有dpf)数据仓库。由于Oracle日期(大致)等同于DB2时间戳,我们经常使用date()函数来转换。从Oracle date数据类型到DB2 date数据类型。

我们已经在20多个Oracle表中使用了这种技术几个月
没有问题。特别是一个表失败,sqlcode为-180
(db2日期值无效)。有谁为什么我们可能会看到这个?
可能是Oracle支持db2支持的范围之外的日期吗?




如果你在命令行上按原样运行查询(没有光标或加载)

,你会得到同样的错误吗?如果是,那么你应该尝试缩小

失败的行,然后查看那里的Oracle DATE值。


-

Knut Stolze

DB2信息集成开发

IBM德国


> > snip<<

我们已经在20多个Oracle桌面上使用了这种技术几个月
没有问题。特别是一个表失败,sqlcode为-180
(db2日期值无效)。有没有人为什么我们可能会看到这个?
可能是Oracle支持db2支持的范围之外的日期吗?



你得到的如果在命令行上按原样运行查询(无光标或加载)
,会出现同样的错误吗?如果是,那么你应该尝试缩小哪些行失败,然后查看那里的Oracle DATE值。

-
Knut Stolze
DB2信息集成开发
IBM德国




感谢Knut;

是 - 无论有没有加载,查询都会失败。事实证明,尽管甲骨文宣称支持最大日期值9999-12-31,但我们设法将
单独输入该表,即使是Oracle也可以告诉我们!当

直接使用date>的WHERE子句查询Oracle时'31 -DEC-9999''",

我们看到单行的值为''16 -APR-39''(?)Go figure ...假设

这是一个Orace bug(说它不是这样!)。谷歌在甲骨文小组中至少有一个人遇到这个谜团......感谢

的帮助。看起来我们需要获得Oracle支持和/或

过滤器,以查找0001-01-01和9999-12-31之间的日期。


Pete H


peteh写道:

snip<<
我们已经在20多个Oracle桌面上使用这种技术好几个月了,没有问题。特别是一个表失败,sqlcode为-180
(db2日期值无效)。有谁为什么我们可能会看到这个?
可能是Oracle支持db2支持的范围之外的日期吗?


如果你得到相同的错误您在命令行上按原样运行查询(无光标或负载)
?如果是,那么你应该尝试缩小哪些行失败,然后查看那里的Oracle DATE值。

-
Knut Stolze
DB2信息集成开发
IBM德国



感谢Knut;
是 - 无论是否加载,查询都会失败。事实证明,虽然甲骨文声称支持最大日期值9999-12-31,但我们设法在这张表中排成一行,甚至甲骨文也无法向我们展示!当使用date>的WHERE子句直接查询Oracle时''31 -DEC-9999''",
我们看到一行的值为''16 -APR-39''(?)Go figure ...假设这是一个Orace bug(说它不是这样!)。谷歌至少有一个人在甲骨文小组中遇到这个谜......感谢你的帮助。看起来我们需要点击Oracle支持和/或
过滤0001-01-01和9999-12-31之间的日期。

Pete H




我怀疑问题是操作员错误而不是Oracle:


SQL * Plus:版本10.2.0.2。 0 - 生产于2006年6月12日星期一13:26:29

版权所有(c)1982,2005,Oracle。保留所有权利。

连接到:

Oracle数据库10g企业版10.2.0.2.0版 - 生产

使用分区,OLAP和数据挖掘选项


SQL> CREATE TABLE datedemo(

2 datecol DATE);


创建表。


SQL> INSERT INTO datedemo

2(datecol)

3 VALUES

4(去年十月('' - 31-DEC-9999'',''DD -MON-YYYY''));


1行创建


SQL>提交;


提交完成。


SQL> SELECT TO_CHAR(datecol,''DD-MON-YYYY'')

2来自datedemo;


TO_CHAR(DATECOL,''DD-
--------------------

31-DEC-9999


SQL>

-

Daniel A. Morgan

华盛顿大学
da ****** @ x.washington.edu

(用u代替x回复)

Puget Sound Oracle用户组
www.psoug.org


Hi All;
We have many production jobs that "load from cursor" to a UDB/AIX 8.2
(with dpf) data warehouse from source tables residing Oracle 9i. Since
Oracle dates are (roughly) equivalent to DB2 timestamps, we frequently
use the date() function to "convert" from the Oracle date datatype to
the DB2 date datatype.

We have used this technique on over 20 Oracle tables for several months
with no problem. One table in particular fails with a sqlcode -180
(invalid db2 date value). Does anyone why we might be seeing this?.
Could it be that Oracle supports dates outside the range of that which
is supported by db2? Any help appreciated. Job output below...

Pete H
-------------------------------------------------
declare fedcurs cursor for
Select item
, loc
, constrstocklowqty
, date(constrstocklowdate)
, constrstocklowdur
, constrstocklowqty
, date(constrstockoutdate)
, constrstockoutdur
, maxconstrcovdur
, date(maxconstrcovdate)
from fdr.manu_skustatstatic
where item not like ''ITC%''
and item not like ''RM%''
and item not like ''PGM%''
and item not like ''IGP%''
and item not like ''ITM%''
;
SQLCODE is: 0

sqlcaid : SQLCA sqlcabc: 136 sqlcode: 0 sqlerrml: 0
sqlerrmc:
sqlerrp : SQL08023
sqlerrd : (1) 0 (2) 0 (3) 511397
(4) 180107 (5) 0 (6) 1
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 00000
SQL stmt is:
load from fedcurs of cursor warningcount 2
messages /xxxx/prod/syslog/irw147.2006-06-05-02:55:08/irw147.loadmsgs
replace into STAGE.manu_skustatstatic
data buffer 600
redirect_part_output
/xxxx/prod/syslog/irw147.2006-06-05-02:55:08/load.log
;
SQLCODE is: -180

sqlcaid : SQLCA sqlcabc: 136 sqlcode: -180 sqlerrml: 0
sqlerrmc:
sqlerrp : SQLSNERR
sqlerrd : (1) 0 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate: 22007

解决方案

peteh wrote:

Hi All;
We have many production jobs that "load from cursor" to a UDB/AIX 8.2
(with dpf) data warehouse from source tables residing Oracle 9i. Since
Oracle dates are (roughly) equivalent to DB2 timestamps, we frequently
use the date() function to "convert" from the Oracle date datatype to
the DB2 date datatype.

We have used this technique on over 20 Oracle tables for several months
with no problem. One table in particular fails with a sqlcode -180
(invalid db2 date value). Does anyone why we might be seeing this?.
Could it be that Oracle supports dates outside the range of that which
is supported by db2?



You get the same error if you run the query as is (w/o cursor or the load)
on the command line? If yes, then you should try to narrow down which rows
are failing and then have a look at the Oracle DATE value there.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


> > snip<<

We have used this technique on over 20 Oracle tables for several months
with no problem. One table in particular fails with a sqlcode -180
(invalid db2 date value). Does anyone why we might be seeing this?.
Could it be that Oracle supports dates outside the range of that which
is supported by db2?



You get the same error if you run the query as is (w/o cursor or the load)
on the command line? If yes, then you should try to narrow down which rows
are failing and then have a look at the Oracle DATE value there.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany



Thanks Knut;
Yes - the query fails with or without the load. Turns out that although
Oracle claims to support a max date value of 9999-12-31, we managed to
get a single row into this table that even Oracle can''t show us! When
querying Oracle directly with a WHERE clause of "date > ''31-DEC-9999''",
we see a single row with a value of ''16-APR-39'' (?) Go figure... Assume
this is an Orace bug (say it ain''t so!). Google shows at least one
other person encountering this mystery in the oracle group... Thanks
for your help. Looks like we''ll need to hit up Oracle support and/or
filter for dates between ''0001-01-01'' and ''9999-12-31''

Pete H


peteh wrote:

snip<<
We have used this technique on over 20 Oracle tables for several months
with no problem. One table in particular fails with a sqlcode -180
(invalid db2 date value). Does anyone why we might be seeing this?.
Could it be that Oracle supports dates outside the range of that which
is supported by db2?


You get the same error if you run the query as is (w/o cursor or the load)
on the command line? If yes, then you should try to narrow down which rows
are failing and then have a look at the Oracle DATE value there.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany



Thanks Knut;
Yes - the query fails with or without the load. Turns out that although
Oracle claims to support a max date value of 9999-12-31, we managed to
get a single row into this table that even Oracle can''t show us! When
querying Oracle directly with a WHERE clause of "date > ''31-DEC-9999''",
we see a single row with a value of ''16-APR-39'' (?) Go figure... Assume
this is an Orace bug (say it ain''t so!). Google shows at least one
other person encountering this mystery in the oracle group... Thanks
for your help. Looks like we''ll need to hit up Oracle support and/or
filter for dates between ''0001-01-01'' and ''9999-12-31''

Pete H



I suspect the problem is operator error rather than Oracle:

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jun 12 13:26:29 2006

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> CREATE TABLE datedemo (
2 datecol DATE);

Table created.

SQL> INSERT INTO datedemo
2 (datecol)
3 VALUES
4 (TO_DATE(''31-DEC-9999'', ''DD-MON-YYYY''));

1 row created

SQL> commit;

Commit complete.

SQL> SELECT TO_CHAR(datecol, ''DD-MON-YYYY'')
2 FROM datedemo;

TO_CHAR(DATECOL,''DD-
--------------------
31-DEC-9999

SQL>
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


这篇关于从光标加载联合(信息集成器) - Oracle日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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