如果ExecuteSQL具有dateTime Offset值,那么它不会选择表吗? [英] ExecuteSQL doesn't select table if it having dateTime Offset value?

查看:77
本文介绍了如果ExecuteSQL具有dateTime Offset值,那么它不会选择表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用数据类型为-dateTimeOffset的单列创建了表,并插入了一些值.

I have created table with single column having data type -dateTimeOffset value and inserted some values.

create table dto (dto datetimeoffset(7))
insert into dto values (GETDATE()) -- inserts date and time with 0 offset
insert into dto values (SYSDATETIMEOFFSET()) -- current date time and offset
insert into dto values ('20131114 08:54:00 +10:00') -- manual way

在Nifi中,我在Execute SQL中指定了从dto选择*" 查询.

In Nifi,i have specified "Select * from dto" query in Execute SQL .

它显示下面的错误..

It shows below error..,

java.lang.IllegalArgumentException: createSchema: Unknown SQL type -155 cannot be converted to Avro type

如果我将该列更改为dateTime,则ExecuteSQL可以正确运行,但在DateTimeOffset列中不起作用.

If i change that column into dateTime then ExecuteSQL runs correctly but it doesn't worked in DateTimeOffset column.

任何帮助表示赞赏.

非常感谢

推荐答案

datetimeoffset是特定于MSSQL的JDBC类型,而ExecuteSQL不支持(它支持标准JDBC类型).您可以尝试将datetimeoffset字段转换为其他一些标准类型,例如datetime,如

datetimeoffset is a MSSQL-specific JDBC type and is not supported by ExecuteSQL (which supports the standard JDBC types). You could try to cast the datetimeoffset field into some other standard type such as datetime, as described here.

这篇关于如果ExecuteSQL具有dateTime Offset值,那么它不会选择表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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