# DatabaseReset Resets a request, like after calling [DatabasePrepare()](/en/docs/database/databaseprepare). ``` int  DatabaseReset(    int  request      // request handle received in DatabasePrepare    ); ``` Parameters request [in]  The handle of the request obtained in [DatabasePrepare()](/en/docs/database/databaseprepare). Return Value Return true if successful, otherwise false. To get the error code, use GetLastError(), the possible responses are: - ERR_DATABASE_INVALID_HANDLE (5121) - invalid database handle; - SQLite error codes starting with ERR_DATABASE_ERROR(5601). Note The DatabaseReset() function is intended for multiple execution of a request with different parameter values. For example, when adding data to the table in bulk using the INSERT command, a custom set of field values should be formed for each entry. Unlike [DatabasePrepare()](/en/docs/database/databaseprepare), the DatabaseReset() call does not compile the string with SQL commands into a new request, therefore DatabaseReset() is executed much faster than DatabasePrepare(). DatabaseReset() is used together with the [DatabaseBind()](/en/docs/database/databasebind) functions and/or [DatabaseBindArray()](/en/docs/database/databasebindarray) if the request parameter values should be changed after executing [DatabaseRead()](/en/docs/database/databaseread). This means that before setting new values of the request parameters (before the block of DatabaseBind/DatabaseBindArray calls), DatabaseReset() should be called to reset it. The parametrized request itself should be created using [DatabasePrepare()](/en/docs/database/databaseprepare). Just like DatabasePrepare(), DatabaseReset() does not make a database request. A direct request execution is performed when calling [DatabaseRead()](/en/docs/database/databaseread) or [DatabaseReadBind()](/en/docs/database/databasereadbind). DatabaseReset() call does not lead to resetting parameter values in the request if they were set by calling DatabaseBind()/DatabaseBindArray(), i.e. the parameters retain their values. Thus, the value of only a single parameter can be changed. There is no need to set all request parameters anew after calling DatabaseReset(). A handle of a request removed using [DatabaseFinalize()](/en/docs/database/databasefinalize) cannot be passed to DatabaseReset(). This will result in an error. Example: ``` //+------------------------------------------------------------------+ //| Script program start function                                    | //+------------------------------------------------------------------+ void OnStart()   { //--- create or open a database    string filename="symbols.sqlite";    int db=DatabaseOpen(filename, DATABASE_OPEN_READWRITE | DATABASE_OPEN_CREATE);    if(db==INVALID_HANDLE)      {       Print("DB: ", filename, " open failed with code ", GetLastError());       return;      }    else       Print("Database: ", filename, " opened successfully"); //--- if the SYMBOLS table exists, delete it    if(DatabaseTableExists(db, "SYMBOLS"))      {       //--- delete the table       if(!DatabaseExecute(db, "DROP TABLE SYMBOLS"))         {          Print("Failed to drop table SYMBOLS with code ", GetLastError());          DatabaseClose(db);          return;         }      } //--- create the SYMBOLS table    if(!DatabaseExecute(db, "CREATE TABLE SYMBOLS("                        "NAME           TEXT    NOT NULL,"                        "DESCRIPTION    TEXT            ,"                        "PATH           TEXT            ,"                        "SPREAD         INT             ,"                        "POINT          REAL    NOT NULL,"                        "DIGITS         INT     NOT NULL,"                        "JSON           BLOB );"))      {       Print("DB: ", filename, " create table failed with code ", GetLastError());       DatabaseClose(db);       return;      } //--- display the list of all fields in the SYMBOLS table    if(DatabasePrint(db, "PRAGMA TABLE_INFO(SYMBOLS)", 0)<0)      {       PrintFormat("DatabasePrint(\"PRAGMA TABLE_INFO(SYMBOLS)\") failed, error code=%d at line %d", GetLastError(), __LINE__);       DatabaseClose(db);       return;      }   //--- create a parametrized request to add symbols to the SYMBOLS table    string sql="INSERT INTO SYMBOLS (NAME,DESCRIPTION,PATH,SPREAD,POINT,DIGITS,JSON)"               " VALUES (?1,?2,?3,?4,?5,?6,?7);"; // request parameters    int request=DatabasePrepare(db, sql);    if(request==INVALID_HANDLE)      {       PrintFormat("DatabasePrepare() failed with code=%d", GetLastError());       Print("SQL request: ", sql);       DatabaseClose(db);       return;      }   //--- go through all the symbols and add them to the SYMBOLS table    int symbols=SymbolsTotal(false);    bool request_error=false;    DatabaseTransactionBegin(db);       for(int i=0; i