Page 1 of 1

[Solved] WARNING: nonstandard use of \\ in a string literal

Posted: 25.02.2014, 15:16
by martinrame
Hi, I'm storing bytea fields in a PostgreSql 8.4 database. When enabling log_collector, I see a lot of this:

Code: Select all

2014-02-25 09:53:57 ART WARNING:  nonstandard use of \\ in a string literal at character 42
2014-02-25 09:53:57 ART HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2014-02-25 09:53:57 ART STATEMENT:  update TurnoWav set IdTurno=1061499, Wav='<\\275\\005\\200\....'


As you can see, the "Wav" field contains escapes.

The original query has parameters, like:

Code: Select all

update TurnoWav set IdTurno=:IdTurno, Wav=:Wav where IdTurnoWav = :IdTurnoWav


To replace the Blob param I use:

lQuery.ParamByName(lFieldName).LoadfromStream(TStream(lObj), ftBlob);

Where lQuery is a TZQuery, and lObj is a TMemoryStream field.

Once params are setted, I just use lQuery.ExecSql.

Is there a something I can do to fix this?.

Re: WARNING: nonstandard use of \\ in a string literal

Posted: 26.02.2014, 10:05
by marsupilami
Hello Leonardo,

which version of Zeos do you use?
Best regards,

Jan

Re: WARNING: nonstandard use of \\ in a string literal

Posted: 26.02.2014, 19:43
by martinrame
Solved by setting TZQuery's Options := [doPreferPrepared];

I'm using 7.0.3