Python Forum
Load data from One oracle Table to Multiple tables - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Load data from One oracle Table to Multiple tables (/thread-31280.html)



Load data from One oracle Table to Multiple tables - amy83 - Dec-01-2020

Hi Experts,
I am in process of learning Python. I am Oracle Developer. I have one source table with Multiple columns. There are several Target tables. I am interested on load data from Source file to Target tables ( need to do all the validations like compare the matched columns data if matched then UPDATE else need to INSERT the data into the table. Need to this validation for all the tables. And would like to automate this process.
Can you please advise is this possible in Python? If possible please advise the logic.

Thanks
Amy.


RE: Load data from One oracle Table to Multiple tables - Larz60+ - Dec-02-2020

Quote:Can you please advise is this possible in Python? If possible please advise the logic.
Python is used for many SQL applications.
In fact, most of PgAdmin is written in python.
There are several methods that can be used, from straight SQL Queries (within python) to using SqlAlchemy
(see my tutorial here: https://python-forum.io/Thread-SqlAlchemy-Tutorial-Basic-Model-database-Creation-and-Data-Load )

SqlAlchemy, uses a model and in many instances the model can be shared between DBMS's by simply changing one line, that controls the engine.

Specific to Oracle, you can google 'using python with oracle'
and browse existing packages (that you can install, simply with pip command) here: https://pypi.org/search/?q=oracle&o=