Page 1 of 1

error too many sql variables

Posted: August 30th, 2020, 8:04 am
by AriSilva
I´m getting this kind of error and I do not figure it out.
The output file xx.csdb could not be opened: too many SQL variables

Re: error too many sql variables

Posted: August 30th, 2020, 9:38 am
by josh
Do you have 999 or more variables in one of your records? That error is probably coming from SQLite which has a limit of 999 variables in a single statement. In CSPro 7.5 we are upgrading to a newer version of SQLite that increases this limit to 32766 but with CSPro 7.4 you will get this error for records with that many variables. If you break up your record up and put some variables on another record you should not get this error.

Re: error too many sql variables

Posted: August 30th, 2020, 10:16 am
by AriSilva
It was working fine with 7.3.
And I think that it is a little more complicated than the number of variables, because I have a version of the faulty file with less records and it seems to work.
Besides, I do not remember exactly, but it executed once when executing directly from the batch editor.
Splitting the variables into separate records will be a problem because at the end I´ll have to export the variables to a stata file, and the user wants everything in a single file, with a single record type.

Re: error too many sql variables

Posted: August 31st, 2020, 7:25 am
by AriSilva
I´ve reinstalled 7.3 and it is working fine so far.

Re: error too many sql variables

Posted: August 31st, 2020, 9:47 am
by josh
The 999 limit would only happen in 7.4. In CSPro 7.3 and below the case is stored in a single column in the database. If you create the file in 7.3 and use it in 7.4 the files stays in the 7.3 format. If you create a new file with the same dictionary in 7.4 then it will use one column per variable and you would hit that error if you have a record with 999 variables or more.