0

I have a requirement like I have an ods file with some data and I want insert that data into a table. This scenario need to be done via procedure call because we have to validate some fields in the ods file. Steps for the requirement. For this, we have two tables like Staging and main table. The staging table contains validation failed records and the main table contains success records. Note: How to do this using python scripting. This will be automate on a daily basis

Step 1:Place the file in a specified location.

Step 2:Pick up file from specified location and call the procedure to insert the records.

Step 3: While calling the procedure needs to handle validation for some fields. Only validation success records needs to be stored in Mani_table. Records which are failed in validation those records need to be stored in the Staging table.

Step 4: Automation script need to be done on daily basis.

Adarsh
  • 303
  • 1
  • 3
  • 13
kishore
  • 3
  • 4

1 Answers1

0

You can move the files across the folders with python's shutil module.

shutil.move("path/to/current/file.foo", "path/to/new/destination/for/file.foo")

Check the more details of it here

You can periodically run the python scripts in multiple ways! I can't comment on the efficiency of these methods, but you can use python's apscheduler. More details of it here

You can use python's pyexcel-ods to read ods files.

Since you haven't added your work, I can't help you more than this!

McLovin
  • 555
  • 8
  • 20
  • I have file in c:/users/downloads/DataFolder/upload_data.ods. The .ods file contains employee data . There are four records in the file we have validation like age should be greater than 21. In that file 3 records are greater than 21 and 1 record age is 20. These validations should be handled in the procedure. The records which are success in validation those records should be stored in main table and failed records needs to be stored in staging table – kishore Dec 18 '19 at 06:17
  • did you try my answer ? – McLovin Dec 19 '19 at 06:51