Unidac, Firebird and UTF8 problem.

Hi,

I'm having problems when triying to store on a Text Blob field(BLOB SUB_TYPE 1) using Unidac. The character set of the firebird DB is UTF8(charecter set on client connection is set also to utf8).

I have the following code(XMLDATA is TBlob):
Cache.XMLDATA.AsUnicodeString := '3300 - REEXPORTACIÓN DE MERCANCÍAS EN EL MISMO ESTADO CON DESTINO A ZEDE';
Manager.Save(Cache);
Using Unidac I get the exception 'Dynamic SQL Error SQL error code = -303 Malformed string', when
using FireDac it works ok.

Using TUniQuery with the following code it also works ok.
Query := TUniQuery.Create(self);
Query.Connection := Connection;
Query.SQL.Text := 'INSERT INTO CACHE_TABLASREF (ID, NOMTABLA, FECHA, XMLDATA) VALUES (1, :p2, :p3, :p4)';
Query.Prepare;
Query.ParamByName('p2').AsString := 'sregimenes';
Query.ParamByName('p3').AsDateTime := Now;
Query.ParamByName('p4').AsString := '3300 - REEXPORTACIÓN DE MERCANCÍAS EN EL MISMO ESTADO CON DESTINO A ZEDE';
Query.Execute;

Any hints?

Thanks in advance,

Omar Zelaya

Aurelius uses AsMemo to set the parameter. Please try setting parameter p4 to ftWideMemo and set it using AsMemo instead of AsString to see if it still fails using TUniQuery.

Have you also added [DBTypeWideMemo] attribute to the FXMLData field mapping?

Hi,

Using AsString or AsWideString with TUniQuery works with no problems. The mapping that generates Data modeler for the field is [DBTypeMemo].

Thanks in advance,

Omar Zelaya

Please try changing it to DBTypeWideMemo.
Please try using AsMemo to see what happens.