ODBC SQL Param inserts only single item/record

Saurabh Narula reachsaurabhnarula@REDACTED
Mon Jun 28 22:46:19 CEST 2010


Hello Everyone,

I am trying to insert records from my erlang program to database which
supports ODBC connections, my sample program is give below -

start_test() ->
odbc:start(),
{ok, Ref} = odbc:connect("DSN=myDB;Database=sqltest;UID=test;PWD=test", []),
odbc:param_query(Ref,"INSERT INTO f1 (f1) VALUES(?)",[{{sql_varchar,
20},["test1", "test2"]}]),
odbc:stop().

this program only inserts value "test1", however if i run it using sql query
by forming query strings, everything just works fine.

Any help would be deeply appreciated.

Thank you everyone.

Saurabh


More information about the erlang-questions mailing list