I want to insert rows into an OCI Autonomous database (version 23c) via python oracledb package:
def _populate_database( auth: dict, args: dict):
with oracledb.connect(user=auth["username"], password=auth["password"], dsn=args["connectionstring"]) as conn:
with conn.cursor() as cursor:
cursor.execute(f"""INSERT ALL
INTO ADMIN.regular VALUES (3203952, 555, 'O', 10.4434, 0, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203953, 5, 'O', 10.25, 4, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203955, 3, 'O', 11.12, 3, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203956, 5, 'O', 10.25, 4, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203957, 27, 'O', 13.25, 4, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203958, 5, 'O', 11.12, 4, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203959, 5, 'O', 10.75, 3, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203960, 5, 'O', 12.4435, 3, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203962, 5, 'O', 11.62, 3, 'my text name', 'my addr 23')
INTO ADMIN.regular VALUES (3203963, 5, 'N', 11.5, 3, 'my text name', 'my addr 23')
SELECT * FROM dual
""")
The command succeeded without error, log, etc, but when I execute a select statement, I don't see any rows.
Can anybody help me, what did I wrong?
executemany()
. See the python-oracledb documentation Executing Batch Statements and Bulk Loading.