本文整理汇总了C++中CppSQLite3Table::setRow方法的典型用法代码示例。如果您正苦于以下问题:C++ CppSQLite3Table::setRow方法的具体用法?C++ CppSQLite3Table::setRow怎么用?C++ CppSQLite3Table::setRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CppSQLite3Table
的用法示例。
在下文中一共展示了CppSQLite3Table::setRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChartAlarmClickSeries
void __fastcall TFrmAlarmDetailList::ChartAlarmClickSeries(TCustomChart *Sender, TChartSeries *Series,
int ValueIndex, TMouseButton Button, TShiftState Shift, int X,
int Y)
{
String strStartDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmStart->Date);
String strEndDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmEnd->Date + 1);
try
{
AnsiString szQuery = " select *, count(Alarm_idx) AS Frequency from AlarmLog "
" where Set_date BETWEEN '" + strStartDateTime + "' AND '" + strEndDateTime + "'"
" AND Alarm_idx < 1000 group by Alarm_idx order by Frequency DESC;";
CppSQLite3Table OrderedTable = dbMain.getTable(szQuery.c_str());
OrderedTable.setRow(ValueIndex);
AnsiString strCode = (String)OrderedTable.fieldValue("Alarm_idx");
AnsiString szAlarmQuery = " select * from AlarmLog, Alarm, Groups, Recipe where Alarm_idx like " + strCode +
" AND Set_date BETWEEN '" + strStartDateTime + "' AND '" + strEndDateTime + "'"
" AND AlarmLog.Alarm_idx = Alarm.idx"
" AND AlarmLog.Group_idx = Groups.idx"
" AND AlarmLog.group_idx = Recipe.group_idx"
" AND AlarmLog.Recipe_idx = Recipe.idx ORDER BY Set_Date DESC";
CppSQLite3Table SelectedTable = dbMain.getTable(szAlarmQuery.c_str());
for(int i = 1; i < grdAlarmLog->RowCount; i++)
{
grdAlarmLog->Rows[i]->Clear();
}
grdAlarmLog->RowCount = 2;
if (SelectedTable.numRows() > 0)
{
for(int row = 0; row < SelectedTable.numRows(); row++)
{
SelectedTable.setRow(row);
grdAlarmLog->Cells[0][row+1] = IntToStr(row+1);
grdAlarmLog->Cells[1][row+1] = (String)SelectedTable.fieldValue(7); // Start date
grdAlarmLog->Cells[2][row+1] = (String)SelectedTable.fieldValue(8); // End date
grdAlarmLog->Cells[3][row+1] = (String)SelectedTable.fieldValue(9); // Alarm Code
grdAlarmLog->Cells[4][row+1] = (String)SelectedTable.fieldValue(11); // Alarm Name
grdAlarmLog->RowCount = row+2;
}
}
}
catch (CppSQLite3Exception& e)
{
cerr << e.errorCode() << ":" << e.errorMessage() << endl;
}
}
示例2: grdErrorDetailSelectCell
void __fastcall TFrmAlarmDetailList::grdErrorDetailSelectCell(TObject *Sender, int ACol,
int ARow, bool &CanSelect)
{
TStringGrid* pGrid = ( TStringGrid* )Sender;
MemoSolution->Clear();
MemoCause->Clear();
if(CanSelect = true)
{
if(pGrid->Cells[ 1 ][ ARow ] != "" &&
pGrid->Cells[ 1 ][ ARow ] != "0" )
{
AnsiString szQuery = "SELECT * FROM " + g_szDBList[_nTableIndex];
INT nErrCode = pGrid->Cells[ 1 ][ ARow ].ToInt();
CppSQLite3DB dbMain;
dbMain.open( AnsiString( g_MainDBPath ).c_str() );
CppSQLite3Table tblAlarm = dbMain.getTable( szQuery.c_str() );
tblAlarm.setRow( nErrCode-1 );
const char* szCause = tblAlarm.getStringField( "cause", "" );
const char* szSolution = tblAlarm.getStringField( "solution", "" );
MemoCause->Lines->Add( szCause );
MemoSolution->Lines->Add( szSolution );
dbMain.close();
pGrid->Refresh();
}
}
}
示例3: GetActionRoom
int32 CLogicThread::GetActionRoom(int64 ParentID,ClauseLogicSense* cls){
CppSQLite3Buffer SQL;
char a[30],b[30];
uint32 PartOfSpeech = 0;
// if(!RBrainHasTable(ID))return 0;
map<int64,MeaningPos>& RoomList = cls->ClauseMeaning;
ToRBrain(ParentID);
int64toa(ParentID,a);
int64toa(MEMORY_INSTINCT,b);
SQL.format("select %s,%s from \"%s\" where %s = \"%s\" ;",
RB_SPACE_ID,
RB_SPACE_VALUE,
a,
RB_SPACE_TYPE,
b
);
CppSQLite3Table t = BrainDB.getTable(SQL);
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
int64 ID = t.getInt64Field(0);
int64 Value = t.getInt64Field(1);
MeaningPos Pos;
Pos.RoomID = ID;
Pos.ParamTokenPos = cls->NextTokenPos;
RoomList[Value] = Pos;
}
return RoomList.size();
}
示例4: GetAllPartOfSpeechRoom
int32 CBrainMemory::GetAllPartOfSpeechRoom(int64 ParentID,map<int64,int64>& RoomList)
{
CppSQLite3Buffer SQL;
char a[30],b[30],c[30];
uint32 PartOfSpeech = 0;
// if(!RBrainHasTable(ID))return 0;
ToRBrain(ParentID);
int64toa(ParentID,a);
int64toa(PARTOFSPEECH_START,b);
int64toa(PARTOFSPEECH_END,c);
SQL.format("select %s,%s from \"%s\" where %s > \"%s\" AND %s< \"%s\";",
RB_SPACE_ID,
RB_SPACE_TYPE,
a,
RB_SPACE_TYPE,
b,
RB_SPACE_TYPE,
c
);
CppSQLite3Table t = BrainDB.getTable(SQL);
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
int64 ID = t.getInt64Field(0);
int64 Type = t.getInt64Field(1);
RoomList[ID] = Type;
}
return RoomList.size();
}
示例5: GetAllPartOfSpeech
uint32 CBrainMemory::GetAllPartOfSpeech(int64 ParentID){
CppSQLite3Buffer SQL;
char a[30],b[30],c[30];
uint32 PartOfSpeech = 0;
// if(!RBrainHasTable(ID))return 0;
ToRBrain(ParentID);
int64toa(ParentID,a);
int64toa(PARTOFSPEECH_START,b);
int64toa(PARTOFSPEECH_END,c);
SQL.format("select %s from \"%s\" where %s > \"%s\" AND %s< \"%s\";",
RB_SPACE_TYPE,
a,
RB_SPACE_TYPE,
b,
RB_SPACE_TYPE,
c
);
CppSQLite3Table t = BrainDB.getTable(SQL);
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
int64 type = t.getInt64Field(0);
PartOfSpeech |= (uint32)((type-PARTOFSPEECH_START));
}
return PartOfSpeech;
}
示例6: JoinTableShow
int CDbMeter::JoinTableShow(const char* dbfilename)
{
try
{
CppSQLite3DB db;
db.open(dbfilename);
CppSQLite3Buffer bufSQL;
CppSQLite3Table t;
db.execDML("CREATE TABLE IF NOT EXISTS jointable (joinkey INTEGER PRIMARY KEY, EUI64ID CHAR(17), jointry INTEGER);");
bufSQL.format("SELECT * FROM jointable;");
t = db.getTable(bufSQL);
for ( int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
for (int fld=0; fld<t.numFields(); fld++)
{
if( !t.fieldIsNull(fld))
XDEBUG("%s | ", t.fieldValue(fld));
}
XDEBUG("\r\n");
}
}
catch( CppSQLite3Exception& e )
{
XDEBUG("%s\r\n",e.errorMessage());
return e.errorCode();
}
return SQLITE_OK;
}
示例7: HasMeaningRoom
int64 CBrainMemory::HasMeaningRoom(int64 ParentTable,int64 Meaning,int64 MeaningType){
CppSQLite3Buffer SQL;
char a[30],b[30];
if(!RBrainHasTable(ParentTable))return 0;
ToRBrain(ParentTable);
int64toa(ParentTable,a);
int64toa(MeaningType,b);
SQL.format("select %s, %s from \"%s\" where %s = \"%s\";",
RB_SPACE_ID,
RB_SPACE_VALUE,
a,
RB_SPACE_TYPE,
b
);
CppSQLite3Table t = BrainDB.getTable(SQL);
if(Meaning == 0){
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
int64 ID = t.getInt64Field(0);
int64 Value = t.getInt64Field(1);
if(ID == Value){
return ID; //已经记忆过了,直接返回
}
}
}else{
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
int64 ID = t.getInt64Field(0);
int64 Value = t.getInt64Field(1);
if(Value = Meaning){
return ID; //已经记忆过了,直接返回
}
}
}
return 0;
}
示例8: GroupAdd
//////////////////////////////////////////////////////////////////////////
// [3/23/2011 DHKim]
// 성공적으로 그룹테이블에 그룹이 추가되면 GroupKey를 리턴한다. 실패시 -1을 리턴
//////////////////////////////////////////////////////////////////////////
int CDbMeter::GroupAdd(const char* dbfilename, char* szGroupName)
{
int nGroupKey = -1;
try
{
CppSQLite3DB db;
db.open(dbfilename);
CppSQLite3Buffer bufSQL;
CppSQLite3Table t;
bufSQL.format("INSERT INTO groups(GroupName) VALUES(%Q);", szGroupName);
db.execDML(bufSQL);
XDEBUG("Success: INSERT Command!!\r\n");
bufSQL.clear();
bufSQL.format("SELECT GroupKey FROM groups WHERE GroupName=%Q;", szGroupName);
//CppSQLite3Query q = db.execQuery(bufSQL);
t = db.getTable(bufSQL);
if( t.numRows() == 0 )
{
XDEBUG("Failure: SELECT Command!!\r\n");
return nGroupKey;
}
else
{
// 동일 이름시 마지막에 추가된 그룹 키를 리턴한다.
int nFinalRow = t.numRows() - 1;
t.setRow(nFinalRow);
if( !t.fieldIsNull(nFinalRow) )
nGroupKey = atoi(t.fieldValue(nFinalRow));
else
{
XDEBUG("Error: GroupKey is NULL!!\r\n");
return nGroupKey;
}
XDEBUG("Success: SELECT Command!!\r\n");
}
//nGroupKey = q.getIntField("GroupKey", -1);
db.close();
}
catch( CppSQLite3Exception& e )
{
XDEBUG("%s\r\n",e.errorMessage());
return -1;
}
return nGroupKey;
}
示例9: BtnCodeReadDataClick
void __fastcall TFrmAlarmDetailList::BtnCodeReadDataClick(TObject *Sender)
{
for(int i = 1; i <=grdAlarmLog->RowCount; i++)
{
grdAlarmLog->Cells[0][i] ="";
grdAlarmLog->Cells[1][i] ="";
grdAlarmLog->Cells[2][i] ="";
grdAlarmLog->Cells[3][i] ="";
}
if(EditAlarmCodeSearch->Text != "")
{
String strStartDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmStart->Date);
String strEndDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmEnd->Date + 1);
String CodeName = EditAlarmCodeSearch->Text.Trim();
grdAlarmLog->RowCount = 2;
try
{
AnsiString szQuery = " select * from AlarmLog, Alarm, Groups, Recipe where Alarm_idx like " + CodeName
+ " AND Set_date BETWEEN '" + strStartDateTime + "' AND '" + strEndDateTime + "'"
+ " AND AlarmLog.Alarm_idx = Alarm.idx"
+ " AND AlarmLog.Group_idx = Groups.idx"
+ " AND AlarmLog.Group_idx = Recipe.group_idx"
+ " AND AlarmLog.Recipe_idx = Recipe.idx;";
CppSQLite3Table tblAlarmLog = dbMain.getTable(szQuery.c_str());
if (tblAlarmLog.numRows() > 0)
{
for (int row = 0; row < tblAlarmLog.numRows(); row++)
{
tblAlarmLog.setRow(row);
grdAlarmLog->Cells[0][row+1] = IntToStr(row+1);
grdAlarmLog->Cells[1][row+1] = (String)tblAlarmLog.fieldValue(7); // Start date
grdAlarmLog->Cells[2][row+1] = (String)tblAlarmLog.fieldValue(8); // End date
grdAlarmLog->Cells[3][row+1] = (String)tblAlarmLog.fieldValue(9); // Alarm Code
grdAlarmLog->Cells[4][row+1] = (String)tblAlarmLog.fieldValue(11); // Alarm Name
grdAlarmLog->RowCount = row+2;
}
}
}
catch (Exception &e)
{
}
}
}
示例10: BtnTimeReadDataClick
void __fastcall TFrmAlarmDetailList::BtnTimeReadDataClick(TObject *Sender)
{
for( INT nRow = 0; nRow < grdAlarmLog->RowCount; nRow++ )
{
grdAlarmLog->Rows[ nRow+1 ]->Clear();
}
grdAlarmLog->RowCount = 2;
AnsiString strStartDateTime = FormatDateTime("yyyy-mm-dd", DateTimeAlarmStart->Date);
AnsiString strEndDateTime = FormatDateTime("yyyy-mm-dd", DateTimeAlarmEnd->Date + 1);
try
{
AnsiString szQuery = "SELECT AlarmLog.set_date, AlarmLog.clear_date, Alarm.idx, Alarm.name, Groups.name, Recipe.name"
" FROM Alarm, AlarmLog, Groups, Recipe"
" WHERE AlarmLog.set_date BETWEEN '" + strStartDateTime + "' AND '" + strEndDateTime + "'"
" AND AlarmLog.alarm_idx = Alarm.idx"
" AND AlarmLog.group_idx = Groups.idx"
" AND AlarmLog.group_idx = Recipe.group_idx"
" AND AlarmLog.recipe_idx = recipe.idx"
" ORDER BY AlarmLog.set_date DESC";
CppSQLite3Table tblAlarmLog = dbMain.getTable( szQuery.c_str() );
for( INT nRow = 0; nRow < tblAlarmLog.numRows(); nRow++ )
{
tblAlarmLog.setRow( nRow );
grdAlarmLog->Cells[ 0 ][ nRow+1 ] = nRow+1;
grdAlarmLog->Cells[ 1 ][ nRow+1 ] = tblAlarmLog.fieldValue( 0 );
grdAlarmLog->Cells[ 2 ][ nRow+1 ] = tblAlarmLog.fieldValue( 1 );
grdAlarmLog->Cells[ 3 ][ nRow+1 ] = tblAlarmLog.fieldValue( 2 );
grdAlarmLog->Cells[ 4 ][ nRow+1 ] = tblAlarmLog.fieldValue( 3 );
grdAlarmLog->RowCount = nRow+2;
}
AlarmFrequencyCount();
}
catch( Exception& e )
{
FrmCdBox->QueryMsg( "DB READ FAIL", "AlarmLog 데이터를 불러오는데 실패 하였습니다.", CD_OK );
}
}
示例11: AlarmFrequencyCount
void TFrmAlarmDetailList::AlarmFrequencyCount()
{
String strStartDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmStart->Date);
String strEndDateTime = FormatDateTime("yyyy-mm-dd 오전 00:00:00", DateTimeAlarmEnd->Date + 1);
try
{
AnsiString szQuery = "select *, count(Alarm_idx) AS Frequency from AlarmLog"
" where Set_date between '" + strStartDateTime + "' AND '" + strEndDateTime + "'"
" and Alarm_idx < 1000 group by Alarm_idx order by Frequency DESC";
CppSQLite3Table tblAlarmLog = dbMain.getTable( szQuery.c_str() );
int nFreq = 0;
String strCode = "";
int nFieldCnt = tblAlarmLog.numRows();
if(nFieldCnt > 0)
{
ChartAlarm->Series[0]->Clear();
for( int i = 0; i < nFieldCnt; i++ )
{
if(i >= 10)
{
return;
}
tblAlarmLog.setRow(i);
nFreq = ((String)tblAlarmLog.fieldValue("Frequency")).ToInt();
strCode = (String)tblAlarmLog.fieldValue("alarm_idx");
ChartAlarm->Series[0]->Add(nFreq, strCode, (Graphics::TColor)(0x20000000));
}
}
}
catch (CppSQLite3Exception& e)
{
}
}
示例12: AnsiString
void TfrmUseSkipViewer::LoadUseSkipNameFromDB()
{
CppSQLite3DB db;
String szSelectQuery = "SELECT * FROM UseSkip";
try
{
if( FileExists( g_MainDBPath ) == true )
{
db.open( AnsiString( g_MainDBPath ).c_str() );
CppSQLite3Table table = db.getTable( AnsiString( szSelectQuery ).c_str() );
if( table.numRows() != 0 )
{
for( int row = 0; row < table.numRows(); row++ )
{
table.setRow( row );
String szName = table.getStringField( "name", "NULL" );
if( szName == "NULL" || szName == "" )
{
szName = "UseSkip" + IntToStr( row );
}
ComboBoxUseSkip->AddItem( szName, NULL );
}
}
db.close();
}
}
catch(Exception &e)
{
db.close();
ShowMessage("Use Skip DB select error! : " + e.Message);
}
}
示例13: main
int main(int argc, char **argv)
{
testCppSQLite();
try
{
DrRobot::Parser file = DrRobot::Parser("files/simple.csv");
CppSQLite3DB* db = getSQLiteDB();
string statement = "create table _data ( ";
string headers = "";
//Print headers
for(int j=0;j<file.columnCount();j++){
std::cout << file.getHeaderElement(j) << "\t\t";
statement += file.getHeaderElement(j)+" TEXT,";
headers += file.getHeaderElement(j);
if(j<file.columnCount()-1)
{
headers += ",";
}
}
statement+="id INTEGER PRIMARY KEY ASC)";
std::cout<<std::endl;
std::cout<<statement<<std::endl;
db->execDML(statement.c_str());
for(int i=0;i<file.rowCount();i++) {
statement = "insert into _data Values(";
for(int j=0;j<file.columnCount();j++){
std::cout << file[i][j] << "\t\t";
statement += "\""+file[i][j]+"\",";
}
statement += "null)";
std::cout << "\n" <<statement << "\t\t";
db->execDML(statement.c_str());
std::cout<<std::endl;
}
CppSQLite3Table t = db->getTable("select * from _data;");
for (int fld = 0; fld < t.numFields(); fld++)
{
cout << t.fieldName(fld) << "|";
}
cout << endl;
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
for (int fld = 0; fld < t.numFields(); fld++)
{
if (!t.fieldIsNull(fld))
cout << t.fieldValue(fld) << "|";
else
cout << "NULL" << "|";
}
cout << endl;
}
}
catch (DrRobot::Error &e)
{
std::cerr << e.what() << std::endl;
}
shutDownDB();
return 0;
}
示例14: testCppSQLite
//.........这里部分代码省略.........
{
cout << q.fieldValue(0) << "|";
cout << q.fieldValue(1) << "|" << endl;
q.nextRow();
}
///////////////////////////////////////////////////////////////
// SQLite's printf() functionality. Handles embedded quotes and NULLs
////////////////////////////////////////////////////////////////
cout << endl << "SQLite sprintf test" << endl;
CppSQLite3Buffer bufSQL;
bufSQL.format("insert into emp (empname) values (%Q);", "He's bad");
cout << (const char*)bufSQL << endl;
db->execDML(bufSQL);
bufSQL.format("insert into emp (empname) values (%Q);", NULL);
cout << (const char*)bufSQL << endl;
db->execDML(bufSQL);
////////////////////////////////////////////////////////////////////
// Fetch table at once, and also show how to
// use CppSQLiteTable::setRow() method
//////////////////////////////////////////////////////////////////
cout << endl << "getTable() test" << endl;
CppSQLite3Table t = db->getTable("select * from emp order by 1;");
for (fld = 0; fld < t.numFields(); fld++)
{
cout << t.fieldName(fld) << "|";
}
cout << endl;
for (int row = 0; row < t.numRows(); row++)
{
t.setRow(row);
for (int fld = 0; fld < t.numFields(); fld++)
{
if (!t.fieldIsNull(fld))
cout << t.fieldValue(fld) << "|";
else
cout << "NULL" << "|";
}
cout << endl;
}
////////////////////////////////////////////////////////////////////
// Test CppSQLiteBinary by storing/retrieving some binary data, checking
// it afterwards to make sure it is the same
//////////////////////////////////////////////////////////////////
cout << endl << "Binary data test" << endl;
db->execDML("create table bindata(desc char(10), data blob);");
unsigned char bin[256];
CppSQLite3Binary blob;
for (i = 0; i < sizeof bin; i++)
{
bin[i] = i;
}
blob.setBinary(bin, sizeof bin);
bufSQL.format("insert into bindata values ('testing', %Q);",
blob.getEncoded());
db->execDML(bufSQL);
cout << "Stored binary Length: " << sizeof bin << endl;
示例15: main
int main(int argc, char** argv)
{
try
{
int row;
CppSQLite3DB db;
cout << "SQLite Header Version: " << CppSQLite3DB::SQLiteHeaderVersion() << endl;
cout << "SQLite Library Version: " << CppSQLite3DB::SQLiteLibraryVersion() << endl;
cout << "SQLite Library Version Number: " << CppSQLite3DB::SQLiteLibraryVersionNumber() << endl;
remove(gszFile);
db.open(gszFile);
////////////////////////////////////////////////////////////////////////////////
// Demonstrate getStringField(), getIntField(), getFloatField()
////////////////////////////////////////////////////////////////////////////////
db.execDML("create table parts(no int, name char(20), qty int, cost number);");
db.execDML("insert into parts values(1, 'part1', 100, 1.11);");
db.execDML("insert into parts values(2, null, 200, 2.22);");
db.execDML("insert into parts values(3, 'part3', null, 3.33);");
db.execDML("insert into parts values(4, 'part4', 400, null);");
cout << endl << "CppSQLite3Query getStringField(), getIntField(), getFloatField() tests" << endl;
CppSQLite3Query q = db.execQuery("select * from parts;");
while (!q.eof())
{
cout << q.getIntField(0) << "|";
cout << q.getStringField(1) << "|";
cout << q.getInt64Field(2) << "|";
cout << q.getFloatField(3) << "|" << endl;
q.nextRow();
}
cout << endl << "specify NULL values tests" << endl;
q = db.execQuery("select * from parts;");
while (!q.eof())
{
cout << q.getIntField(0) << "|";
cout << q.getStringField(1, "NULL") << "|";
cout << q.getIntField(2, -1) << "|";
cout << q.getFloatField(3, -3.33) << "|" << endl;
q.nextRow();
}
cout << endl << "Specify fields by name" << endl;
q = db.execQuery("select * from parts;");
while (!q.eof())
{
cout << q.getIntField("no") << "|";
cout << q.getStringField("name") << "|";
cout << q.getInt64Field("qty") << "|";
cout << q.getFloatField("cost") << "|" << endl;
q.nextRow();
}
cout << endl << "specify NULL values tests" << endl;
q = db.execQuery("select * from parts;");
while (!q.eof())
{
cout << q.getIntField("no") << "|";
cout << q.getStringField("name", "NULL") << "|";
cout << q.getIntField("qty", -1) << "|";
cout << q.getFloatField("cost", -3.33) << "|" << endl;
q.nextRow();
}
q.finalize();
////////////////////////////////////////////////////////////////////////////////
// Demonstrate getStringField(), getIntField(), getFloatField()
// But this time on CppSQLite3Table
////////////////////////////////////////////////////////////////////////////////
cout << endl << "CppSQLite3Table getStringField(), getIntField(), getFloatField() tests" << endl;
CppSQLite3Table t = db.getTable("select * from parts;");
for (row = 0; row < t.numRows(); row++)
{
t.setRow(row);
cout << t.getIntField(0) << "|";
cout << t.getStringField(1) << "|";
cout << t.getIntField(2) << "|";
cout << t.getFloatField(3) << "|" << endl;
}
cout << endl << "specify NULL values tests" << endl;
for (row = 0; row < t.numRows(); row++)
{
t.setRow(row);
cout << t.getIntField(0, -1) << "|";
cout << t.getStringField(1, "NULL") << "|";
cout << t.getIntField(2, -1) << "|";
cout << t.getFloatField(3, -3.33) << "|" << endl;
}
cout << endl << "Specify fields by name" << endl;
for (row = 0; row < t.numRows(); row++)
{
t.setRow(row);
cout << t.getIntField("no") << "|";
cout << t.getStringField("name") << "|";
cout << t.getIntField("qty") << "|";
//.........这里部分代码省略.........