For UnixODBC and Oracle ODBC, to get long 64 bit value the proper approch will be to fetch the value as a string.
Use SQL_C_CHAR Then you can convert the value in long long (64 bit) using strtoll.
SQL_C_CHAR
strtoll
This will also work for negative numbers.