You are not logged in.
Pages: 1
I'm trying to insert a object into a table and I get this error from the server:
"Too many : ( ) : params".
The table(class) that I'm trying to insert has 65 fields (published properties).
What could be the cause of this error?
Last edited by ManUn (2013-02-19 12:45:54)
Offline
At SynCommons.pas you have
MAX_SQLFIELDS = 64;Change this value according to this text:
MAX_SQLFIELDS default is still 64, but can now be set to any value (64,
128, 192 and 256 have optimized fast code) so that you can have any number
of fields in a Table"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal
Offline
Thank you for the answer, but, this is already in 128. Even If I change to 256 the error continues.
function ExtractInlineParameters(const SQL: RawUTF8;
var Types: TSQLParamTypeDynArray; var Values: TRawUTF8DynArray;
var maxParam: integer; var Nulls: TSQLFieldBits): RawUTF8;
var ppBeg: integer;
P, Gen: PUTF8Char;
wasNull: boolean;
begin
(...)
if maxParam>high(Types) then
raise ESynException.Create('Too many :(): params'); //<--- error occurs here
(...)
end;Last edited by ManUn (2013-02-19 13:18:48)
Offline
This limitation should be removed now.
You can delete the whole check, since the Types[] array is now a dynamic array, resized within the internal loop.
Online
Beautiful, thanks!! ![]()
Offline
Sorry for reviving such an old thread, but I ran into this issue while migrating to mORMot v2.
In my case, I'm trying to delete 89 records using a DELETE FROM ... WHERE RowID IN (...) statement and I get a "Too many parameters..." error.
In the old codebase, I had an internal limit of 900 parameters for such operations (SQLite allows anywhere from 999 to 32,766, depending on the version).
In mORMot there is a MAX_SQLPARAMS = 500 constant, but it doesn't seem to be taken into account during parameter parsing. Instead, MAX_SQLFIELDS (which defaults to 64) is used: https://github.com/synopse/mORMot2/blob … e.pas#L842
Is this a bug, or is it the intended behavior?
Last edited by zed (Today 12:11:27)
Offline
In my case, I’ll pass the RowIDs as literals instead of parameters, as it doesn’t make any practical difference here (as I suppose).
Offline
Pages: 1