user9652780
user9652780

Reputation: 21

How to set date using OCCI::Date::setDate method

I am trying to create a OCCI::Date object using setDate method but I get an error while doing so.

Below is the snippet of my code.

using ODate = oracle::occi::Date;
ODate ts;
ts.setDate(datetime.year(),datetime.month(),datetime.day(),datetime.hour  (),datetime.minute(),datetime.second());

this is the error I get - ORA-32146: Cannot perform operation on a null date

I also printed the values that I am passing to setDate method to check if those values are correct and they are all fine and within the Date range.

datetime.year()  = 2018
datetime.month() = 6
datetime.day() = 5
datetime.hour() = 6
datetime.minute() = 1
datetime.seconds() = 22

Any leads to resolve this issue?

Upvotes: 1

Views: 489

Answers (1)

JKC
JKC

Reputation: 109

Oracle has its own format of storing date. Check this link.

Set the resulted value in OCIDate.OCIDateYYYY

Upvotes: 1

Related Questions