Inserting Values
In the first form of insertion, values are supplied directly from program variables:
 
int videoID = 1234;
int supplierID = 11;
int purchaseOrderNumber = 999;
RWDecimalPortable pricePerUnit("29.95");
int quantity = 12;
RWDateTime date(RWDateTime::setCurrentTime);
 
RWDBTable purchases = myDbase.table("purchase");
RWDBInserter insert = purchases.inserter();
insert << videoID << supplierID << purchaseOrderNumber
<< pricePerUnit << quantity << date; //1
insert.execute(myConnection);
As usual, an inserter is obtained for the purchase table. On //1, we supply values for a row in the table, adding them to the inserter with the insertion operator. When the execute() method is invoked, the database is accessed and a row of data is inserted into the table.