Untitled
unknown
plain_text
2 years ago
625 B
8
Indexable
# ... (previous code)
# Inside your main function, update the code where you construct insert_values
for column_name, source_val in source_row.items():
if source_val is not None:
if isinstance(source_val, str) and source_val.startswith('TO_DATE'):
# If it already starts with TO_DATE, don't add TO_DATE again
insert_values.append(source_val)
else:
# Format datetime values using TO_DATE
insert_values.append(f"TO_DATE('{source_val}', 'YYYY-MM-DD HH24:MI:SS')")
else:
insert_values.append('NULL')
# ... (the rest of your code remains the same)
Editor is loading...