I don't know CxRichedit but if it behaves like VCL RichEdit I think you have to write
FDQuery1.ParamByName('allkeys').asString := cxRichEdit2.lines.Text;