I want to parse a user-uploaded CSV file from a interface to database and show the imported records from database in the same interface

I have a interface where user can upload a CSV file. In the process model I have some duplicate checking functionality and then "import csv to database" smart service to insert the data to the database table. Now, I want to show a short message to the user that, how many of the records are successfully stored in the database. I want to show it in a modal or somewhere below in that interface (the CSV upload interface). How can I achieve that?

  Discussion posts and replies are publicly visible

Parents
  • Hi Sudipta,
    I would assume the volume of data in CSV file would be on a higher side, so it is not advisable to store the values in process variable after parsing.

    1)Use com.appiancorp.ps.exceltools-2.0.2.jar plugin--> Import CSV to Database(smart service) to achieve this use case.
    2)In your process model call execute stored procedure(smart service) to retrieve the total count of data(Before Parsing). You may use select count(1) from TABLE query in a stored procedure to get total count before and after writing the new file and display in the UI.
    3) If you are doing any dublicate checks use another stored procedure(Write cursor logic inside).
    4) Always have a staging table to insert the data of CSV file parsed through the above mentioned plugin and once parsed call stored procedure(Cursor logic to check duplicate).

    The method is very efficient and takes only few seconds.
    ***Refrain from storing data in PV*** use the plugin (smart service- Import CSV to Database) to make it very efficient.

    Hope that helps!

    Abhishek

Reply
  • Hi Sudipta,
    I would assume the volume of data in CSV file would be on a higher side, so it is not advisable to store the values in process variable after parsing.

    1)Use com.appiancorp.ps.exceltools-2.0.2.jar plugin--> Import CSV to Database(smart service) to achieve this use case.
    2)In your process model call execute stored procedure(smart service) to retrieve the total count of data(Before Parsing). You may use select count(1) from TABLE query in a stored procedure to get total count before and after writing the new file and display in the UI.
    3) If you are doing any dublicate checks use another stored procedure(Write cursor logic inside).
    4) Always have a staging table to insert the data of CSV file parsed through the above mentioned plugin and once parsed call stored procedure(Cursor logic to check duplicate).

    The method is very efficient and takes only few seconds.
    ***Refrain from storing data in PV*** use the plugin (smart service- Import CSV to Database) to make it very efficient.

    Hope that helps!

    Abhishek

Children
No Data