Hi everyone I already searched for previous posts no clue, I am trying to insert date field type from Oracle to Sybase ( which has nothing stored procedure or NOT NULL constraint on traget DB side). I tried to check in couple of was NOT NULL as
1)
If IsNull(trim(Oracle_br.ENDDATE)) Then @NULL Else Oracle_br.ENDDATE
This generats this errors and no rows are inserted
Event type:Warning
Message:
At row 67, link "br_sybase"
Sybase Server message 3621 (severity 10) from stored procedure 'Input_0', line 1: Command has been aborted.
At row 67, link "br_sybase"
Sybase Server warning 515 (severity 16) from stored procedure 'Input_0', line 1: Attempt to insert NULL value into column 'enddate', table 'provider'; column does not allow nulls. Update fails.
2)
If IsNull(trim(Oracle_br.ENDDATE)) Then " " Else Oracle_br.ENDDATE
Out put is it inserts " Jan 1 1900 12:00AM " at target column, which I no need to ...
all I need is just if the source has some value insert else keep in empty...
Thanx for reading and any reply is appreciated.
Error during inserting Date values to Sybase DB
Moderators: chulett, rschirm, roy
You may want to replace @NULL with @DATE.If IsNull(trim(Oracle_br.ENDDATE)) Then @NULL Else Oracle_br.ENDDATE
Code: Select all
If Len(trim(Oracle_br.ENDDATE))=0 Then @DATE Else Oracle_br.ENDDATE