Talend tDRow component gives error ORA-00933

496 Views Asked by At

I'm using the component tDBRow in Talend where I execute a simple query, that is the following:

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

but when I launch my job the error ora-00933 sql command not properly ended pops out. Is this a context variable use problem? I've searched and seen I could write like this but it doesn't work.

EDIT I've tried the same query in SQL Developer, using a random date, and no error is given.

1

There are 1 best solutions below

1
Ibrahim Mezouar On

The problem is that you're not correctly constructing your query. I'm guessing context.builtIn_lastRunDate is a string, so you should enclose it in quotes like so:

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

If context.builtIn_lastRunDate is of date type, you need to format it to a string like so:

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