64bit unsigned long and SQLT_NUM in OCI
631687Apr 2 2008 — edited Dec 17 2008Hi all,
I'm trying to insert in a NUMBER(38) field a values which is a 64bit integer.
Obviously I have to test if it works with the max allowed value (2^64 -1).
I Use OCIBindByName:
tag_to_insert = 18446744073709551615UL;
rc = OCIBindByName(p_sql, &p_bnd, p_err, (text *) ":taggo", -1, (dvoid *) &tag_to_insert, sizeof(unsigned long), SQLT_NUM, (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT);
Problem is: if use SQLT_NUM no rows gets inserted into DB, if I use SQLT_INT I get a value of -1 instead of the correct one of 18446744073709551615.
What am I missing ?
I'm using Oracle11-64bit on a 64bit RedHat.
Any clues ?
thanks