0
I need to load some data that are in spreadsheets in a relational database, but I have been facing some challenges regarding the insertion of foreign keys.
In these images you can see that I first insert the project data, the auto increment of the database generates a key, I recover it in the table input and then turn this step with Excel Input of the relief data sheet.
I have only one project and several reliefs related to it.
The project data is in a spreadsheet and the relief data is in a different spreadsheet.
When trying to enter no error is returned, but the relief data is not included. It’s a seemingly simple problem, but I’m starting to understand Kettle now.
Thank you in advance!
EDIT2:
In fact, I need to complete the output of the project table in order to recover the auto increment id that will be generated and include it in the relief table. I did a test with the merge, as you suggested, but I can’t visualize how useful it would be for me, since the completion of one flow is necessary for the beginning of the other.
– Sabrina T.
I would need an example to help you in this case, it wasn’t very clear to me. Do you want to update the relief table from data from the project table ? Or from project table data you perform searches in the relief table ?
– Cristian Curti
That’s it, I want to update the relief table from the project table data. The project has an ID that is generated automatically. What I need is for this automatically generated project ID to be inserted into the relief table, making it possible to link the tables. I’ll insert the print in the post to be clear.
– Sabrina T.
As you can see in the image, I entered the project and the automatically generated ID was 157. Now, to realize the relationship with the relief table, I need to retrieve that 157 and insert into these relief table data.
– Sabrina T.
I was doing this process manually, the problem is that the bank is in constant use and as there are many tables, ended up becoming unviable.
– Sabrina T.
I edited the answer with a possible solution.
– Cristian Curti
It only worked when only one amount is recovered. For example, when I need to update several different Ids like you put in your example, it didn’t work. The first number was repeated for everyone, instead of each line receiving a different value. I edited the question with the images to be clearer.
– Sabrina T.
It may be necessary to control the data flow with 2 KTR’s inside a JOB, but still think that a WHERE clause in your update would better solve the problem.
– Cristian Curti