int f( void ) { // results from the query CTEXTSTR *results; // connect. PODBC odbc = ConnectToDatabase( "system_dsn_name" ); // do a command, does a temporary entry on the stack, unless the database is slow SQLCommandf( odbc, "create temporary table my_test_table( ID int, value int )" ); // start a new entry on the command stack. SQLRecordQueryf( odbc, NULL, &results, NULL, "select 1+1" ); // when this command is done, it is stacked on the query. SQLCommandf( odbc, "insert into my_test_table (value) values(%d)", 1234 ); // at this point there is technically 2 entries on the command stack until the next // FetchSQLResult( odbc, &results ); }