获取本地时区的当前时间ESQL消息代理

时间:2015-06-09 20:14:36

标签: ibm-mq ibm-integration-bus extended-sql

我试图通过命令获取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

如果有人能帮助我,我会很感激。 此致

1 个答案:

答案 0 :(得分:1)

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

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

相反,请使用CURRENT_TIMESTAMP。