I am writing a VB.NET application that moves data from a MS SQL database table to an Oracle database table.
A record in the MS SQL DB has a null date. The Oracle db table column is set to allow nulls. When I run the VB.NET application and step through the app, everything works fine until the record with the null date. VB.NET shows the null date as ’12:00 AM’ with no date, just the time.
The Oracle error I get is: ORA-01847: day of month must be between 1 and last day of month
Here is the SQL to pull in the date from the MS SQL DB:
convert(varchar(10),DATE_COLUMN,101) end as 'DATE_COLUMN'
Here is the PL/SQL I have for inserting into the Oracle DB:
to_date('" & tmp_DATE_COLUMN & "','mm/dd/yyyy')

Looks like your
tmp_something_DATEvariable is of typeDate. Problem is that it cannot storeNULL/Nothingvalues in aDatevariable. If you try to assign aDateto Nothing, it is really assigned toDate.MinValue, which equals to#12:00:00 AM#. You either needNullable(Of Date)or useDataTablecolumn values directly.