Import Excel to different tables in database

Hi all,

I have a requirement of importing the excel file to database. When the user upload an excel file in import it should create new data in 3 different tables.

For example, in the excel file the data present is based on deals and each deal can have one or more number of loans and the deal will be having some amount values. So when the user upload a file it should update deals table, loans table an other table which contains of amount data of the deal.

Thank you.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    We may need to use a two-step process for this requirement:

    1. **Upload to a Staging Table**: First, when the user uploads the Excel file, the entire data can be written to a temporary staging table. This ensures that the raw data from the Excel file is captured in a structured manner without directly affecting the main tables. Any validations or initial transformations can also be performed here.

    2. **Populate Data to Main Tables**: After the data is in the staging table, we can read the relevant information and populate the required main tables—such as the *deals* table, *loans* table, and a separate table for the deal amount values. The necessary business logic to relate deals and loans should be handled in this step.

    3. **Clear Staging Table**: Once the data is successfully written to the main tables, the staging table can be cleared, ensuring it's ready for the next upload 

Reply
  • 0
    Certified Lead Developer

    We may need to use a two-step process for this requirement:

    1. **Upload to a Staging Table**: First, when the user uploads the Excel file, the entire data can be written to a temporary staging table. This ensures that the raw data from the Excel file is captured in a structured manner without directly affecting the main tables. Any validations or initial transformations can also be performed here.

    2. **Populate Data to Main Tables**: After the data is in the staging table, we can read the relevant information and populate the required main tables—such as the *deals* table, *loans* table, and a separate table for the deal amount values. The necessary business logic to relate deals and loans should be handled in this step.

    3. **Clear Staging Table**: Once the data is successfully written to the main tables, the staging table can be cleared, ensuring it's ready for the next upload 

Children