C++ (Qt) QSqlDatabase DBStoreWrite= QSqlDatabase::addDatabase("QFIREBIRD","DBStoreWrites"); DBStoreWrite.setConnectOptions("CHARSET=WIN1251"); DBStoreWrite.setDatabaseName("DBStore"); DBStoreWrite.open("SYSDBA","masterkey"); QSqlQuery SqlTest(DBStoreWrite); DBStoreWrite.transaction(); SqlTest.prepare("INSERT INTO Cans (CANNUM,DTTM,CANVALUE) VALUES (:CANNUM,'NOW',:CANVALUE)"); for (int i=0;i<2;i++) { SqlTest.bindValue(0,1); SqlTest.bindValue(1, i); SqlTest.exec(); } DBStoreWrite.commit(); DBStoreWrite.close();
insert into .... (primary_column) values (null)
if (primary_column is null) then primary_column = gen_id(primary_generator,1)