Solution: ODBC - could not coerce arguments
Hi All, Just for the records, I've found the answer finally on my previous question. YES it was an encoding problem. It is your responsibility to know how your ODBC link (in ODBC administrator) is configured and what encoding it is waiting for. All strings must be passed for the ODBC classes correctly encoded. In my example it was CP1250. *encodedquery := yourquery* *encodeWith: (ZnByteEncoder newForEncoding: 'cp1250').* (Yes, Zn... classes are present as I'm making it for web) It results in a ByteArray but don't worry, ODBC system accepts it in *execute:* and maybe its other messages as well. Best regards Robert
On 10 Apr 2016, at 15:03, Robert Kuszinger <kuszinger@giscom.hu> wrote:
Hi All,
Just for the records, I've found the answer finally on my previous question.
YES it was an encoding problem.
It is your responsibility to know how your ODBC link (in ODBC administrator) is configured and what encoding it is waiting for.
All strings must be passed for the ODBC classes correctly encoded.
In my example it was CP1250.
encodedquery := yourquery encodeWith: (ZnByteEncoder newForEncoding: 'cp1250').
It's great that you found your way out. Good of you to report back.
(Yes, Zn... classes are present as I'm making it for web)
Zn is a standard part of Pharo as HTTP is a crucial technology in todays world. I just wanted to clarify that ZnByteEncoder is part of the package Zinc-Character-Encoding which has nothing to do with web, just as the classes in Zinc-Resource-Meta they are dependents of Zinc that are generally useful. BTW, it is better to say (ZnCharacterEncoder newForEncoding: 'cp1250') or even 'cp1250' asZnCharacterEncoder (or #cp1250 asZnCharacterEncoder) since ZnByteEncoder is an implementation class.
It results in a ByteArray but don't worry, ODBC system accepts it in execute: and maybe its other messages as well.
Best regards Robert
participants (2)
-
Robert Kuszinger -
Sven Van Caekenberghe