Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] using toracle row for insert into oracle table

Hi, 
my job is like :
tfileList-->tfileinputdelimite-->tmap-->toracleoutput--->onComponentOK-->toraclerow
i want use toaclerow to insert information into a oracle table :
this is my query :
"INSERT INTO  KPI.HTTP_TRACE(NOM, NBRE_LIGNES_FICHIER ,  NBRE_LIGNES_TABLE , NBRE_LIGNES_INSER , NBRE_LIGNES_REJET, ENTER_DATE)
  values ('" +
                   ((String)globalMap.get("tFileList_1_CURRENT_FILE")) +"',"+
                   ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) +"',"+
                     ((Integer)globalMap.get("tOracleOutput_1_NB_LINE"))+"',"+
                    ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED"))+"',"+
                     ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_REJECTED"))+"',"+
                      TalendDate.getCurrentDate()+
             ")"
when i execute i have error that missing comma,
and also i have an id primary key in my table so how can i insert the value of  this primary key 
Thanks for your help 
Labels (2)
28 Replies
Anonymous
Not applicable
Author

Hello
You probably missed some single quotes at the end of your lines :  +"',"+
Anonymous
Not applicable
Author

Hi 
  ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) +"',"+

There is a syntax error in your query, you don't need to add single quote for Integer type.
Best regards
Shong
Anonymous
Not applicable
Author

Thanks Shong, 
so my query should like this :
"INSERT INTO  KPI.HTTP_TRACE(NOM, NBRE_LIGNES_FICHIER ,  NBRE_LIGNES_TABLE , NBRE_LIGNES_INSER , NBRE_LIGNES_REJET, ENTER_DATE)
  values ('" +
                   ((String)globalMap.get("tFileList_1_CURRENT_FILE")) +"',"+
                   ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) +","+
                     ((Integer)globalMap.get("tOracleOutput_1_NB_LINE"))+","+
                    ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED"))+","+
                     ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_REJECTED"))+","+
                      TalendDate.getCurrentDate()+
             ")"
i still have the same error missing comma 
help me please 
Thanks
Anonymous
Not applicable
Author

Hi,
Try following
"INSERT INTO  KPI.HTTP_TRACE(NOM, NBRE_LIGNES_FICHIER ,  NBRE_LIGNES_TABLE , NBRE_LIGNES_INSER , NBRE_LIGNES_REJET, ENTER_DATE) values (" + ((String)globalMap.get("tFileList_1_CURRENT_FILE")) +","+((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) +","+((Integer)globalMap.get("tOracleOutput_1_NB_LINE"))+","+((Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED"))+","+((Integer)globalMap.get("tOracleOutput_1_NB_LINE_REJECTED"))+","+TalendDate.getCurrentDate()+")"
Copy paste into notepad and from notepad to your sqlrow component...
Vaibhav
Anonymous
Not applicable
Author

I copy your query But i still have the same error 
ORA-00917: missing comma
ORA-00917: missing comma
can you explain to me if my conception of job is correct the link on componentok which execute the toraclerow to insert the data into my table for each file or what 
help me please i don't know how can i resolve the error 
Thanks
Anonymous
Not applicable
Author

Not able to visualize what you have written... but it is sure that we don't need OnComponentOk to ensure that the previous task is completed.... In place of this, we need OnSubjobOk link..
I will be more clear if you can put the screenshot of your job.
Vaibhav
Anonymous
Not applicable
Author

This is my screen shot 
0683p000009MEbY.jpg
i want to load into a table for each file the numbre of lines of the files and the numbre of toracleoutput insert 
i copy your query but i have the error of missing comma 
so is my job correct for each file can i insert the numbre of lines and nbre inserted
and is my query correct 
Thanks for your great help 
Anonymous
Not applicable
Author

For tOracleRow_1 component, use anther iterate(2) link from tFileList. This insures that the first data insert operation is complete and you are starting second operation  after completion of first...
How you are getting number of lines rejected? whether the Reject link is available from your output component? This link is available
- when you disable die on error
- disable batch count in advance setting
Vaibhav
Anonymous
Not applicable
Author

i do the link iterate from tfileList to toracle row but i have the same error 
this my query :
"INSERT INTO  KPI.HTTP_TRACE(NOM, NBRE_LIGNES_FICHIER ,  NBRE_LIGNES_TABLE , NBRE_LIGNES_INSER , ENTER_DATE)
 values (" +
                     ((String)globalMap.get("tFileList_1_CURRENT_FILE")) +","+
                    ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) +","+
                   ((Integer)globalMap.get("tOracleOutput_1_NB_LINE"))+","+
                    ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_REJECTED"))+","+
                  TalendDate.getCurrentDate()+")"
0683p000009MEcD.jpg
can you help me please 
Thanks