Пример #1
0
 /// <summary>
 /// Executes an SQL command agains a FastDB connection.
 /// </summary>
 /// <param name="Updatable">Determines if records can be updated (optional, default: false).</param>
 /// <param name="FetchFirst">Instructs to fetch the first record (optional, default: false).
 /// If false, the user must call First() method after Execute().</param>
 /// <returns>Number of records in the record-set fetched from the database.</returns>
 public int  Execute(bool Updatable, bool FetchFirst)
 {
     if (connection.Threaded)
     {
         connection.Attach();
     }
     Describe();
     read_only = !Updatable;
     row_count =
         CLI.CliCheck(
             CLI.cli_fetch(statement, (Updatable) ? CLI.QueryType.cli_for_update : CLI.QueryType.cli_view_only));
     rec_no = (FetchFirst) ? 0 : -1;
     eof    = row_count <= 0;
     if (FetchFirst && !eof)
     {
         First();
     }
     else
     {
         bof = FetchFirst;
     }
     return(row_count);
 }