Inserting negative OCIInterval (YEAR(5) TO MONTH) is not equal to interval literal equivalent
Hi all,
I have a table with an INTERVAL YEAR(5) TO MONTH column and I try to insert values with OCIInterval handles.
I could not find a clear description in the documentation about setting the value of an OCIInterval...
After some tries it appears that you have to initialize the OCIInterval with OCIIntervalFromText() to "00-00" (otherwise you get ORA-01873).
Then you can set the year and month parts with OCIIntervalSetYearMonth().
If the value is negative like -55555-11, I call OCIIntervalSetYearMonth() with year=-55555 and month=11 ...
The value seems to insert properly (SELECT from sqlplus shows -55555-11, SELECT ... WHERE col = ? with same OCIInterval use for INSERT returns the row).
I have a table with an INTERVAL YEAR(5) TO MONTH column and I try to insert values with OCIInterval handles.
I could not find a clear description in the documentation about setting the value of an OCIInterval...
After some tries it appears that you have to initialize the OCIInterval with OCIIntervalFromText() to "00-00" (otherwise you get ORA-01873).
Then you can set the year and month parts with OCIIntervalSetYearMonth().
If the value is negative like -55555-11, I call OCIIntervalSetYearMonth() with year=-55555 and month=11 ...
The value seems to insert properly (SELECT from sqlplus shows -55555-11, SELECT ... WHERE col = ? with same OCIInterval use for INSERT returns the row).
0