src/ResultSet.cpp
branchv_0
changeset 53 cc6ffeba0fe5
parent 48 c83119110c7b
child 58 a4907b207f0c
equal deleted inserted replaced
52:656b5aecd4a2 53:cc6ffeba0fe5
    53 
    53 
    54 relpipe::writer::integer_t ResultSet::getInteger(unsigned short columnNumber, bool* isNull) {
    54 relpipe::writer::integer_t ResultSet::getInteger(unsigned short columnNumber, bool* isNull) {
    55 	// TODO: get integer directly from SQLGetData() without string conversion
    55 	// TODO: get integer directly from SQLGetData() without string conversion
    56 	relpipe::writer::string_t s = getString(columnNumber, isNull);
    56 	relpipe::writer::string_t s = getString(columnNumber, isNull);
    57 	if (isNull && *isNull) return 0;
    57 	if (isNull && *isNull) return 0;
    58 	else return std::stol(s);
    58 	else return std::stoll(s);
    59 }
    59 }
    60 
    60 
    61 relpipe::writer::string_t ResultSet::getString(unsigned short columnNumber, bool* isNull) {
    61 relpipe::writer::string_t ResultSet::getString(unsigned short columnNumber, bool* isNull) {
    62 	SQLCHAR uselessBuffer; // just to get stringLength – ODBC does not eat nullptr
    62 	SQLCHAR uselessBuffer; // just to get stringLength – ODBC does not eat nullptr
    63 	SQLLEN stringLength = -1;
    63 	SQLLEN stringLength = -1;