To retrieve data from Oracle:
import devart.oracle as oracle
connect() module method and obtain a connection object.
my_connection = oracle.connect(
Direct=True,
Host="your_server",
ServiceName="your_service_name",
UserName="your_username",
Password="your_password"
)
cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
execute() cursor method.
my_cursor.execute("SELECT * FROM employees")
fetch*() cursor methods.
for row in my_cursor.fetchall():
print(row)