# DatabaseBindArray Sets an array as a parameter value. ``` bool  DatabaseBind(    int  request,      // the handle of a request created in DatabasePrepare    int  index,        // the parameter index in the request    T&   array[]       // parameter value as an array    ); ``` Parameters request [in]  The handle of a request created in [DatabasePrepare()](/en/docs/database/databaseprepare). index [in]  The parameter index in the request a value should be set for. The numbering starts with zero. array[] [in]  The array to be set as a request parameter value. Return Value Returns true if successful, otherwise - false. To get the error code, use GetLastError(), the possible responses are: - ERR_INVALID_PARAMETER (4003)              – unsupported type; - ERR_ARRAY_BAD_SIZE (4011)                    - array size in bytes exceeds INT_MAX; - ERR_DATABASE_INVALID_HANDLE (5121)  - invalid database handle; - ERR_DATABASE_NOT_READY (5128)    - cannot use the function to make a request at the moment (the request is being executed or already complete, DatabaseReset should be called). Note The function is used in case an SQL request contains "?" or "?N" parameterizable values where N means the parameter index (starting from one). At the same time, parameters indexing in DatabaseBindArray() starts from zero. For example: ```      INSERT INTO table VALUES (?,?,?) ``` The function may be called immediately after a parametrized request is created in [DatabasePrepare()](/en/docs/database/databaseprepare) or after the request is reset using [DatabaseReset()](/en/docs/database/databasereset). Use this function together with [DatabaseReset()](/en/docs/database/databasereset) to execute the request as many times as needed with different parameter values. Example: ``` //+------------------------------------------------------------------+ //| Script program start function                                    | //+------------------------------------------------------------------+ void OnStart()   { //--- open the dialog for selecting files with the DAT extension    string selected_files[];    if(!FileSelectDialog("Select files to download", NULL,                        "Data files (*.dat)|*.dat|All files (*.*)|*.*",                        FSD_ALLOW_MULTISELECT, selected_files, "tester.dat")>0)      {       Print("Files not selected. Exit");       return;      } //--- get the size of files    ulong filesize[];    int filehandle[];    int files=ArraySize(selected_files);    ArrayResize(filesize, files);    ZeroMemory(filesize);    ArrayResize(filehandle, files);    double total_size=0;    for(int i=0; i