Using SQLDA under 64 bits [message #352785] |
Thu, 09 October 2008 10:23 |
donato
Messages: 53 Registered: November 2007 Location: Barcelona, Spain
|
Member |
|
|
Hi people!
I'm migrating my Pro*C applications to 64 bits.
I have a technical doubt.
In Oracle's Pro*C sample10.pc, the way to obtain NUMBER columns is:
...
if (select_dp->T[i] == 3) /* int datatype */
printf ("%*d ", (int)select_dp->L[i], *(int *)select_dp->V[i]);
...
Well, in my application i want to assign this column to a 'long' variable. Under 32 bits, I did something like:
long_var = *(long *)select_dp->V[i];
It was working fine because i was compiling in LP32 mode, where 'int', 'long' and pointers has 32 bytes.
Well, under 64 bits it doesn't work, and i have to change this assignment to:
long_var = *(int *)select_dp->V[i];
This way, it's still running fine. But i'm not surely that it is the most securely option.
I'm starting in 64 bits world, and i have no great knowledge about this kind of assignments. Am I on the right way?
Are there any possibility (maybe assigning another value to SQLDA->T[]) wich allow me to use:
long_var = *(long *)select_dp->V[i];
I think this option is most clear:
long = *(int *)char**; /* Works fine */
long = *(long *)char**; /* Not works, but it seems to me to be clearer */
Or maybe SQLDA doesn't differentiate between 'int' and 'long', and all this post is unnecesary...
Any suggestion, please?
Thanks so much!!
|
|
|