Forum

Armin Winkler
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
    2 years ago #30388
    Up
    0
    Down
    ::

    Hi Dimitri,

     

    the approach you propose to populate a table in your SQL data base is considered to be potentially unsafe and abusable, since the user that is executing the statement needs to have File privileges granted to them on the server. The official MySQL documentation itself warns to grant such privileges and execute said LOAD DATA statement, cf. https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html.

     

    I would recommend you to implement your own import function in a Simplifier application using Javascript functionality. Here are the basic steps you need to take in your app workflow:

     

    1. Use a sap.ui.unified.FileUploader widget to get access to your local .txt file

    2. Read in the file as a text with the help of a FileReader

    3. Pass the text as input to the client-side business object ITIZ_CSV and its function CSV_to_JSON which is part of our Standard Content

    4. Use a repeatable statement SQL connector call which is invoked from a server-side business object function to pass the whole JSON array and insert it into your data base table

     

    Kind regards,

     

    Armin