Hi:

Assuming that the definition of the dBase does not change, I wonder if the two pseudo code schemas are equally valid or if there are pros and cons in each one:

//  Design -A-  ====================

do {
      // Compile the statement into a virtual machine
      resp = sqlite3_prepare_v2( );
      if (resp != XXXX ) {
         // some action
      }
      // Bind the data to SQL variables
      sqlite3_bind_xxxb  ();

      // Call sqlite3_step() to run the virtual machine
      resp = sqlite3_step(pStmt);
      if ( some condition on resp) { /* ... */ }

      // Finalize the virtual machine.
      resp = sqlite3_finalize();
      if (resp == SQLITE_OK)  break;
} while( resp == xxx );

// Design -B-  ================

// Compile the statement into a virtual machine
resp = sqlite3_prepare_v2( );
if (resp != XXXX ) {
    // some action
}
// Bind the data to SQL variables
sqlite3_bind_xxxb  ();

do {
      // Call sqlite3_step() to run the virtual machine
      resp = sqlite3_step(pStmt);
      if ( some condition on resp) { /* ... */ }
} while( resp == xxx );

// Finalize the virtual machine.
resp = sqlite3_finalize();
if (resp != SQLITE_OK)  Some-action;

The above construct is supposed inside a function who process a query; may be a SELECT; UPDATE or INSERT statement.

Thanks in advance.

Adolfo


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to