The documentation about OCIBindByPos
talks about array of lengths and array of indicators but makes no statement about how the length of the array itself is made known to OCI. Please explain how.
If you are passing an array for valuep then the value_sz would be the maximum possible value and you pass an array of actual lenghts to alenp corresponding to the elements in the bind array passed to valuep.
All these are explained in the same doc referenced in the link you pointed to.