<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE></TITLE>
<STYLE>
body, table, tr, td, p {font-family: Verdana;font-size:12px;margin: 0px 0px 0px 0px}
.bgtabl {BACKGROUND-REPEAT: no-repeat}
</STYLE>
</HEAD>
<BODY bgProperties="fixed" bgcolor="#FFFFFF" background="http://flashimg.club-internet.fr/flash/vide.gif">



Hi Laura!<br>
I replay the same test as you (on Crux Linux) and I get the same error:<br>
<br>
10> odbc:sql_query(Ref, "delete from cosa where
c1=2").                     
<br>
{error,"No SQL-driver information available."}<br>
<br>
It seems to be a bug or something missing in the interface.<br>
/ycrux<br>
<br>----Message d'origine----
<br>>Date: Wed, 28 Sep 2005 13:03:42 +0200
<br>>De: "Laura M. Castro" <laura @alfa21.com="">
<br>>A: Lista de Erlang <erlang-questions @erlang.org="">
<br>>Sujet: ODBC application error
<br>>
<br>>
<br>>  Hi all,
<br>>
<br>>    We have found a little confusing behaviour concerning the Erlang
<br>>ODBC driver. This is a case example: connecting to the (postgresql)
<br>>database through ODBC (using the isql utility), we can perform the
<br>>following set of commands:
<br>>
<br>>lcastro:~$ isql ourdatabase
<br>>+---------------------------------------+
<br>>| Connected!                            |
<br>>|                                       |
<br>>| sql-statement                         |
<br>>| help [tablename]                      |
<br>>| quit                                  |
<br>>|                                       |
<br>>+---------------------------------------+
<br>>SQL> create table cosa (c1 integer, c2 varchar);
<br>>SQLRowCount returns 0
<br>>
<br>>SQL> select * from cosa;
<br>>+------------+------------+
<br>>| c1         | c2
<br>>
<br>>
<br>>                                                                   |
<br>>+------------+------------+
<br>>+------------+------------+
<br>>SQLRowCount returns 0
<br>>
<br>>SQL> insert into cosa values (1, 'Hola');
<br>>SQLRowCount returns 1
<br>>
<br>>SQL> insert into cosa values (12, 'Holaa');
<br>>SQLRowCount returns 1
<br>>
<br>>SQL> insert into cosa values (123, 'Holaaa');
<br>>SQLRowCount returns 1
<br>>
<br>>SQL> insert into cosa values (1234, 'Holaaaa');
<br>>SQLRowCount returns 1
<br>>
<br>>SQL> insert into cosa values (12345, 'Holaaaaa');
<br>>SQLRowCount returns 1
<br>>
<br>>SQL> select * from cosa;
<br>>+------------+------------+
<br>>| c1         | c2         |
<br>>+------------+------------+
<br>>| 1          | Hola
<br>>
<br>>
<br>>                                                                    |
<br>>| 12         | Holaa
<br>>
<br>>
<br>>                                                          |
<br>>| 123        | Holaaa     |
<br>>| 1234       | Holaaaa
<br>>
<br>>
<br>>                                                        |
<br>>| 12345      | Holaaaaa
<br>>
<br>>
<br>>                                                       |
<br>>+------------+------------+
<br>>SQLRowCount returns 5
<br>>
<br>>5 rows fetched
<br>>SQL> select * from cosa where c1 = 2;
<br>>+------------+------------+
<br>>| c1         | c2         |
<br>>+------------+------------+
<br>>+------------+------------+
<br>>SQLRowCount returns 0
<br>>
<br>>SQL> delete from cosa where c1 = 2;
<br>>SQLRowCount returns 0
<br>>
<br>>
<br>>
<br>>    But if we do the same through the Erlang ODBC driver, have a look at
<br>>the result we get:
<br>>
<br>>Eshell V5.4.9  (abort with ^G)
<br>>1> application:start(odbc).
<br>>ok
<br>>2> {ok, C} = odbc:connect("DSN=ourdatabase",[{auto_commit, off},
<br>>{timeout, infinity}, {scrollable_cursors, off}, {trace_driver, off},
<br>>{tuple_row, off}]).
<br>>{ok,<0.42.0>}
<br>>3> odbc:sql_query(C, "select * from cosa", infinity).
<br>>{selected,["c1","c2"],
<br>>          [[1,"Hola"],
<br>>           [12,"Holaa"],
<br>>           [123,"Holaaa"],
<br>>           [1234,"Holaaaa"],
<br>>           [12345,"Holaaaaa"]]}
<br>>4> odbc:sql_query(C, "select * from cosa where c1=2", infinity).
<br>>{selected,["c1","c2"],[]}
<br>>5> odbc:sql_query(C, "delete from cosa where c1=2", infinity).
<br>>{error,"No SQL-driver information available."}
<br>>
<br>>
<br>>    What I am trying to show it that I guess the Erlang ODBC driver may
<br>>have some kind of problem with those SQL DELETE statements which
<br>>eventually do not delete anything :-?
<br>>
<br>>    Any help/comment will be very welcome...
<br>>
<br>>    Thanks in advance,
<br>>
<br>>  Laura Castro
<br>>
<br>>P.S. We were using Erlang R9C-2 but we have also tried with the newest
<br>>version, Erlang R10B-7 and the situation remains the same.
<br>>
<br>>

</erlang-questions></laura></body></html>