[erlang-questions] mysql driver in erlang support stored procedure
Seven Du
dujinfang@REDACTED
Sun Jan 23 14:24:19 CET 2011
Unfortunately we need to support legacy DBs.
On Sat, Jan 22, 2011 at 5:56 AM, Alain O'Dea <alain.odea@REDACTED> wrote:
> On 2011-01-21, at 12:40, Seven Du <dujinfang@REDACTED> wrote:
>
>> Hi,
>>
>> I was using erlang_mysql_driver for a while, but it seems doesn't
>> support stored procedure.
>>
>> Then I found another driver called EMysql
>> https://github.com/JacobVorreuter/emysql , on test it does support
>> call procedure, however, it returns ok_packets sometimes on select
>> only procedures, and it happens also for simple selects(where it
>> should always be result_packet I think):
>>
>> fetch4() ->
>> SQL = "select * from test;",
>> Result = emysql:execute(mysql2, SQL),
>> io:format("~p~n", [Result]),
>> Fields = Result#result_packet.field_list,
>> Rows = Result#result_packet.rows,
>>
>> io:format("~p~n", [Fields]),
>> io:format("~p~n", [Rows]).
>>
>>
>>> mytest:fetch4().
>> {ok_packet,28,0,0,2,0,[]}
>> ** exception error: {badrecord,result_packet}
>> in function m_telsystem:fetch/0
>>
>>
>> I should report an issue on github but the only issue there is still
>> in unread state and it's not been updated since 2009. There are other
>> clones of the project, but not sure which one will has support.
>>
>> Any one has experience on this or other options?
>>
>> erlang_mysql_driver is quite state besides I haven't got it support
>> stored procedure.
>>
>> Thanks.
>>
>> --
>> About: http://about.me/dujinfang
>> Blog: http://www.dujinfang.com
>> Proj: http://www.freeswitch.org.cn
>>
>
> PostgreSQL is largely equivalent to MySQL and has mature support in epgsql in Zotonic. If it is an option I recommend using PostgreSQL instead.
--
About: http://about.me/dujinfang
Blog: http://www.dujinfang.com
Proj: http://www.freeswitch.org.cn
More information about the erlang-questions
mailing list