When extracting data via INSERT
statements with Toad, date fields get hard-coded to the date stored in the database in the form of TO_DATE('<the_date>','MM/DD/YYYY HH24:MI:SS')
. Many times the actual date in the source table doesn't matter, and you would rather insert SYSDATE
in the destination table instead.
Since the dates can be different in each statement, a standard Find/Replace doesn't help automate the process of converting the TO_DATE
s to SYSDATE
s. However, you can use this regular expression that is agnostic about the content between the parentheses:
TO_DATE\(.*?\)
Most text editors have a regex option in the Find/Replace function. I have tested this successfully with Sublime Text and Notepad++, but the TextPad regex engine does not support it.