Erlang and Mysql database connectivity problem

I wanna to put my problems over here,Hope i ll get your suggestion to use it

For my web application “HiPe Result publisher in Erlang” we need to use the database to store data,so we headed into it.

Just we used to start “mysql” and created a table followed by inserted some values those are described here:

CREATE DATABASE `test`;

CREATE TABLE `test`.`test_table`
(
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(45) NOT NULL,
`last_name` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE =
InnoDB;

INSERT INTO `test`.`test_table`
(
`first_name`,
`last_name`
) VALUES
(‘Matt’, ‘Williamson’), (‘Matt’, ‘Williamson2′), (‘Matt’, ‘Williamson3′);

inserted;

after that,

We have started to enter the code to connect with the database in erlang

In erlang shell,<by typing the ‘erl’ in terminal’>
1)application:start(odbc).

ConnString = “DSN=mysqldb”.

2){ok, Conn} = odbc:connect(ConnString, []).
3)Results = odbc:sql_query(Conn, “SELECT * FROM test_table”).

but here,I got “Exception error,no match of right hand side value{error,”No SQL-SERVER INFORMATION AVAILABLE”},connection to database failed}.

http://www.erlang.org/cgi-bin/ezmlm-cgi/4/38545

The same problem posted by some one but i need to get the answer

waiting for your valuable one!

About these ads

About Navaneethan

"Preparing myself to participate"!!
This entry was posted in Free Software, Problems, Prob_system and tagged . Bookmark the permalink.

4 Responses to Erlang and Mysql database connectivity problem

  1. Carl Wright says:

    I was curious about your problem so I tried myself. Here’s my try.

    c:\>erl
    Eshell V5.7.5 (abort with ^G)
    1> application:start(odbc).
    ok
    2> ConnString = “DSN=astro1_development”.
    “DSN=astro1_development”
    3> {ok, Comm} = odbc:connect(ConnString,[]).
    {ok,}
    4> Results = odbc:sql_query(Comm,”select * from calls”).
    {selected,["id","call_start","from_nbr","duration","to_nbr",
    "to_city","cost","rating_period"],
    [{1,"2006-10-09 22:00:00","7348272000",1.3,"2463042381",
    "Battle Creek, MI",0.02,"1"},
    {2,"2006-10-10 14:02:00","7348272000",23.5,"2487732835",
    "Muskegon, MI",0.45,"1"},
    {3,"2006-10-10 09:09:00","7348272000",5.6,"7349448588",
    "Saline, MI",0.11,"1"},
    {4,"2006-10-10 10:09:00","7348272000",3.4,"7349448588",
    "Saline, MI",0.06,"1"},
    {5,"2006-10-10 10:28:00","7348272000",1.2,"7349448588",
    "Saline, MI",0.02,"1"},
    {6,"2006-10-11 17:11:00","7348272000",13.8,"2347732835",
    "Muskegon, MI",0.26,"1"},
    {4377,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785","EL MONTE",98.95,"1"},
    {4378,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785","dest_city_state",98.95,"1"},
    {4379,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785",null,98.95,"1"},
    {4380,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785","EL MONTE",98.95,"1"},
    {4381,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785","dest_city_state",98.95,"1"},
    {4382,"2005-06-04 22:57:09","16266755785",5208.0,
    "16266755785","EL MONTE, CA",98.95,"1"}]}
    5>

    I don’t know why my query worked and yours didn’t, but here are things that might be different and might matter.

    1. My DSN was a system DSN in Windows XP.

    2. I tested the DSN with the ODBC Connector in the Windows Administrative Tools.

    3. I’m using an up-to-date version of Erlang.

    The error message in your problem did concern me. It refers to “SQL-SERVER”. This might be a generic message or it might refer to “Microsoft SQL Server”. Is there anything in your setup that might send the ODBC to an SQL server driver rather than a MYSQL Driver? It is a selection in the definition of a DSN.

    I hope that this helps.

  2. Navaneethan says:

    First i have thank you for your kindest reply:-)
    It doesn’t work in my friend’s box but the same time it was worked with other fresh distro:-)

    but i don’t know what the mistake was actually:-(

    hope it ll be cleared soon

  3. Navaneethan says:

    I connected erlang odbc mysql and need to know how to add(process in) it in backround when i click the button

  4. dhivahar says:

    brother installing drupal after creating user i found error on database creation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s