Error during inserting Date values to Sybase DB

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mkiru23
Premium Member
Premium Member
Posts: 33
Joined: Thu Nov 20, 2003 4:33 pm
Location: SFL

Error during inserting Date values to Sybase DB

Post by mkiru23 »

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. 8)
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Post by 1stpoint »

If IsNull(trim(Oracle_br.ENDDATE)) Then @NULL Else Oracle_br.ENDDATE
You may want to replace @NULL with @DATE.

Code: Select all

If Len(trim(Oracle_br.ENDDATE))=0 Then @DATE Else Oracle_br.ENDDATE
Post Reply