academiadocodigo/SimpleORM

parâmetro string acima de 4000 caracteres resulta erro "Data too large for variable "

Opened this issue · 0 comments

erro ocorre na unit SimplesDAO function TSimpleDAO.FillParameter(aInstance: T): iSimpleDAO;
onde os param são passados como variante FQuery.Params.ParamByName(Key).Value := DictionaryFields.Items[Key];

Com alteração abaixo não teria mais problemas em carregar grandes testos ate mesmo campos blob do banco.

if Length(DictionaryFields.Items[Key]) > 4000 then
FQuery.Params.ParamByName(Key).AsMemo := DictionaryFields.Items[Key]
else
FQuery.Params.ParamByName(Key).Value := DictionaryFields.Items[Key];