0

我正在尝试在 esql 中获取本地时区的当前小时,以满足命令的要求:

set throttle_time = EXTRACT(HOUR FROM LOCAL_TIMEZONE);

但它给了我一个例外,如下所示:

ExceptionList
RecoverableException
        File:CHARACTER:F:\build\slot1\S000_P\src\DataFlowEngine\MessageServices\ImbDataFlowNode.cpp
        Line:INTEGER:1153
        Function:CHARACTER:ImbDataFlowNode::createExceptionList
        Type:CHARACTER:ComIbmComputeNode
        Name:CHARACTER:SiebelTOSPOSRequestHandler#FCMComposite_1_7
        Label:CHARACTER:SiebelTOSPOSRequestHandler.Compute1
        Catalog:CHARACTER:BIPmsgs
        Severity:INTEGER:3
        Number:INTEGER:2230
        Text:CHARACTER:Node throwing exception
        RecoverableException
                File:CHARACTER:F:\build\slot1\S000_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
                Line:INTEGER:666
                Function:CHARACTER:SqlStatementGroup::execute
                Type:CHARACTER:
                Name:CHARACTER:
                Label:CHARACTER:
                Catalog:CHARACTER:BIPmsgs
                Severity:INTEGER:3
                Number:INTEGER:2488
                Text:CHARACTER:Error detected, rethrowing
                Insert
                        Type:INTEGER:5
                        Text:CHARACTER:.SiebelTOSPOSRequestHandler_counternode.Main
                Insert
                        Type:INTEGER:5
                        Text:CHARACTER:6.3
                Insert
                        Type:INTEGER:5
                        Text:CHARACTER:SET throttle_time = CAST(EXTRACT(HOUR FROM LOCAL_TIMEZONE) AS CHARACTER);
                RecoverableException
                        File:CHARACTER:F:\build\slot1\S000_P\src\DataFlowEngine\ImbRdl\ImbRdlDateTimeFunctions.cpp
                        Line:INTEGER:503
                        Function:CHARACTER:ExtractFnCall::extractHour
                        Type:CHARACTER:
                        Name:CHARACTER:
                        Label:CHARACTER:
                        Catalog:CHARACTER:BIPmsgs
                        Severity:INTEGER:3
                        Number:INTEGER:2477
                        Text:CHARACTER:Cannot extract %3 field from value %4
                        Insert
                                Type:INTEGER:5
                                Text:CHARACTER:.SiebelTOSPOSRequestHandler_counternode.Main
                        Insert
                                Type:INTEGER:5
                                Text:CHARACTER:6.28
                        Insert
                                Type:INTEGER:5
                                Text:CHARACTER:HOUR
                        Insert
                                Type:INTEGER:5
                                Text:CHARACTER:INTERVAL '360' MINUTE

如果有人可以帮助我,我将不胜感激。问候

4

1 回答 1

1

你说你想要“本地时区的当前小时”。

LOCAL_TIMEZONE 不返回任何包含您想要的内容。仔细阅读这篇文章以获得解释。另外,作为一个简单的实验,运行“SET Environment.temp = LOCAL_TIMEZONE;” 然后看看 Environment.temp 的结果值和数据类型是什么。

相反,请使用 CURRENT_TIMESTAMP。

于 2015-06-18T22:18:27.223 回答