【问题标题】:Talend tDRow component gives error ORA-00933Talend tDRow 组件给出错误 ORA-00933
【发布时间】:2019-03-22 08:56:06
【问题描述】:

我在 Talend 中使用组件 tDBRow,我在其中执行一个简单的查询,如下所示:

" 
insert into test.wk_sf_l_srv_cshistory_to_load select
ID, 
CREATEDDATE
from test.CASE_HISTORY_FULL
where createddate >=  " +context.builtIn_lastRunDate +  " "

但是当我启动我的工作时,错误ora-00933 sql command not properly ended 会弹出。这是上下文变量使用问题吗?我已经搜索并看到我可以这样写,但它不起作用。

编辑我在 SQL Developer 中尝试了相同的查询,使用随机日期,并且没有给出错误。

【问题讨论】:

    标签: sql talend ora-00933


    【解决方案1】:

    问题在于您没有正确构建查询。我猜context.builtIn_lastRunDate 是一个字符串,所以你应该用引号将它括起来,如下所示:

    "insert into test.wk_sf_l_srv_cshistory_to_load select
    ID, 
    CREATEDDATE
    from test.CASE_HISTORY_FULL
    where createddate >=  '" + context.builtIn_lastRunDate +  "'"
    

    如果context.builtIn_lastRunDate 是日期类型,则需要将其格式化为这样的字符串:

    ".. where createddate >= '" + TalendDate.formatDate("<date format here>", context.builtIn_lastRunDate) + "'"
    

    【讨论】:

    • lastRunDate 是一个日期,如果我使用该方法,它会告诉我括号有问题,即使它们没问题...
    猜你喜欢
    • 1970-01-01
    • 2010-11-22
    • 2015-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 2014-10-23
    • 1970-01-01
    相关资源
    最近更新 更多