0
CREATE TABLE STU(ID INT PRIMARY KEY, NAME VARCHAR2(20), AGE INT)
INSERT INTO STU VALUES(1, 'ZJW', 24)
INSERT INTO STU VALUES(2, 'YGL', 25)
INSERT INTO STU VALUES(3, 'ZLY', 24)
INSERT INTO STU VALUES(4, 'LBZ', 22)
CPP代碼:
int nId;
string strName;
int nAge;
cout << "ID\t" << "NAME\t" << "AGE" << endl;
while (rs->next() == true)
{
// get values using the getXXX() methods of Resultset
nId = rs->getInt(1);
strName = rs->getString(2);
nAge = rs->getInt(3);
cout << nId << "\t" << strName << "\t" << nAge << endl;
}
當我使用OCCI查詢從Oracle數據,我得到這個錯誤: ORA -01455:轉換列溢出integer數據類型
我的系統是centos 64位,我知道int是2147483647,而oracle INTEGER是-2 31)到(2 31)-1。 那麼爲什麼我得到這個溢出錯誤? tks。