Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Save files name and content in two table

Hi everyone,

 

I need to save many files in two tables oracle

- table parent  : save filename and sysdate

- table child : save content file + PK of parent table 

 

 

Thank you in advance

Labels (2)
9 Replies
TRF
Champion II
Champion II

And your question is?
Anonymous
Not applicable
Author

Now I can save in the parent table, but not correct in the child table.0683p000009LuCh.png

Do you have an idea please.

thanks.

 

cterenzi
Specialist
Specialist

I would recommend you use OnSubjobOk instead of OnComponentOk on the connection to tOracleInput_1.

 

If the purpose of tOracleInput_1 is to retrieve the records from the parent table in order to provide the keys for the insert into the child table, you probably want to make that flow your lookup and the flow from your tFileInputPositional the main.  Beyond that, we'll need more details about the problem you are experiencing.  Are you getting an error message?  Is the job finishing but not writing the expected information to one or both of your tables?

Anonymous
Not applicable
Author

Hi,

What's the error you are getting for your subjob 2(child)?

Here is a KB article about:https://help.talend.com/pages/viewpage.action?pageId=190513190

Hope it will be helpful.

Best regards

Sabrina

Anonymous
Not applicable
Author

Thanks for your replies. I have no errors in my job, but i have the same contents in my two child tables. 

File 1 

name : file1.txt

content :

100Name

200Country

300ADRESS

File 2

name : file2.txt

content :

400Name

500Country

600ADRESS

 

In my table, Parent, i have two records, file1.txt and file2.txt, => correct

But in my tables : child 1 and child 2 i have the same contents.

cterenzi
Specialist
Specialist

If your job design is the same as your screenshot on 4-14, you're not going to get the results you expect. If you are iterating over a list of files, those should be the main flow in your tMap, and the query from the database should be the lookup.
Anonymous
Not applicable
Author

i changed the main flow in tMap, and the query from the database in lookup.

now i get the contents  two files in the same table 1.

vardhane
Contributor
Contributor

Hi, We have a similar scenario. We are using MySql. We want to loop through the files in directory and insert the filename and sysdate in first table which is having auto increment ID column. The newly inserted filename ID has to be taken to another table along with the content of the file.

PFA ,Currently we could load the data into main table wiithout the fileid from first table.

Can someone please help us, using which component we can achieve our requirement.

 

Table1                                

ID

FILENAME

SYSDATE

 

 Table2

ID

FILEID(ID column from Table1)

CLI

EST ...

 

Thanks in advance!


billing.PNG
Anonymous
Not applicable
Author

I also looked for a solution but could not get an answer anywhere. Maybe this is wrong, but I did so. In tMap, I created a stream with a file name and identifier. On the way to the database with a table of file names, I added an aggregator with the key file name and with the aggregation function of only the first record.0683p000009M9eT.png