- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-13-2024 12:35 PM
Hi Community! Iām working in a Fatabricks notebook and using the Oracle JDBC Thin Client connector to query and Oracle table, merge together and select specific rows from my dataframe and write those rows to a table back in Oracle. All of this works well so far, however I need to be able to delete a subset of records from an Oracle table before inserting new ones. Iāve tried using a cursor.execute with a parameterized delete statement, and Databricks appears to successfully run, but no rows are deleted from the target table. Is there an example someone can provide where this does work, as google searches have produced very little to try.
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2024 06:26 AM
Turns out the issue was my command format. After many re-attempts with changes along the way - I finally had success using the format:
sql_delete = "DELETE FROM owner.table_name WHERE ROW_ID BETWEEN :value1 AND :value2"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-14-2024 09:45 PM
This stack overflow post ran into the same issue, would be worth trying How to delete a record from Oracle Table in Python SQLAlchemy - Stack Overflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-15-2024 06:26 AM
Turns out the issue was my command format. After many re-attempts with changes along the way - I finally had success using the format:
sql_delete = "DELETE FROM owner.table_name WHERE ROW_ID BETWEEN :value1 AND :value2"

