You should SQL_C_CHAR to fetch the value as a string and then convert it to a long long (64-bit interger) with strtoll.
SQL_C_CHAR
long long
strtoll