erlang ODBC module and large query/response
Tomasz Sterna
tomasz.sterna@REDACTED
Mon Oct 24 15:40:40 CEST 2005
I have a problem getting very long fields from my PostgreSQL database by erlang.
When I make a query, I get only 8215 characters of a long field.
INSERTing this kind of data is also erroneus.
Here is what i did so far:
First I recompiled unixODBC with:
#define SQL_MAX_MESSAGE_LENGTH 1048576
My test C application returns whole field data now.
But when testing from erlang I get only 8215 characters of field data:
$ erl
Erlang (BEAM) emulator version 5.4.9 [source] [hipe] [threads:0] [kernel-poll]
Eshell V5.4.9 (abort with ^G)
1> {ok, Ref} = odbc:connect("DSN=ejabberd;", [{scrollable_cursors,off}]).
{ok,<0.38.0>}
2> odbc:sql_query(Ref, "SELECT * FROM users WHERE username='smoku'").
{selected,["username","password"],[{"smoku","xxxxxxxx"}]}
3> odbc:sql_query(Ref, "SELECT * FROM vcard WHERE username='smoku'").
{selected,["username","vcard"],
[{"smoku",
"<vCard xmlns='vcard-temp' prodid='-//HandGen//NONSGML
vGen v1.0//EN' version='2.0' xdbns='vcard-temp'>\r\n<FN>Tomasz
Sterna</FN>\r\n<NICKNAME>smoku</NICKNAME>\r\n<PHOTO>\r\n<TYPE>image/png</TYPE>\r\n<BINVAL>\r\niVBORw0[.BASE64_DATA.]67vSHQi"}]}
Any idea on how to overcome this limitation?
--
smk
More information about the erlang-questions
mailing list