I am new to erlang, sorry I might be missing something very small. I am trying the following code for a DB handler to oracle in Erlang, in red-hat.
#!/usr/bin/env escript
-module(test).
-compile(export_all).
-define(CONNECT_OPTIONS,[
{auto_commit, on},
{scrollable_cursors, off},
{trace_driver, on}
]).
-define(CONNECT_STRING,"DSN=oracle10g;DBQ=*******;UID=********;PWD=********").
main(_)->
odbc:start(),
{ok, ConnObj} = odbc:connect(?CONNECT_STRING,?CONNECT_OPTIONS),
io:format(ConnObj).
I have the unix odbc and oracle thin-client installed, the respective DSN is also declared in the /etc/odbc.ini file and also ~/.odbc.ini file .
but I run in to the following error :
escript: exception error: no match of right hand side value {error, "[unixODBC][Driver Manager]Data source name not found, and no default driver specified SQLSTATE IS: 00000 Connection to database failed."}
Can someone please explain how to establish a connection handler to oracle DB in erlang.
Thanks in advance.