<div dir="ltr"><div>Dear Eugen Yu,</div>
<div> </div>
<div>In the mail thread, Eduardo has given the solution...</div>
<div>Please go through the following link for more ideas....</div>
<div><a href="http://www.erlang.org/pipermail/erlang-questions/2007-March/025606.html">http://www.erlang.org/pipermail/erlang-questions/2007-March/025606.html</a></div>
<div>In my SQL DB, I have used NVARCHAR datatype. This type is not suppotred in Erlang ODBC. So, I have changed the type to VARCHAR which is supported in Erlang ODBC. Thus the problem is solved.</div>
<div> </div>
<div>Hope this helps.<br><br></div>
<div class="gmail_quote">On Mon, Jul 14, 2008 at 3:59 AM, Eugen Hon Wai Yu <<a href="mailto:Eugen.Yu@rwth-aachen.de">Eugen.Yu@rwth-aachen.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello Surindar,<br><br>I have read your thread on the Erlang mailing list.<br>You have had some problem accessing a posgresql using the odbc module of erlang.<br>
Can you tell me how you solved the problem?<br>I am also trying to use a erlang's odbc module to access data of a postgres server.<br>There is no problem with the integer however I cannot read string.<br>This is what I did:<br>
<br>1) Create schema<br><br>odbc:start(),<br>{ok, Ref} = odbc:connect("DSN=MyDataSource", [{scrollable_cursors, off}]),<br> odbc:sql_query(Ref,<br>                  "CREATE TABLE EMPLOYEE (NR integer, FIRSTNAME  varchar(20), LASTNAME  varchar(20), GENDER char(1),PRIMARY KEY(NR))"),<br>
odbc:sql_query(Ref, "INSERT INTO EMPLOYEE VALUES(1, 'Jane', 'Doe', 'F')"),<br>odbc:stop().<br><br>With the squirrel jdbc client I can see that the schema has been created and there is one row in it.<br>
<br>2) Now I try to read the data<br><br>odbc:start(),<br>{ok, Ref} = odbc:connect("DSN=MyDataSource", [{scrollable_cursors, off}]),<br>X = odbc:sql_query(Ref, "SELECT FIRSTNAME FROM EMPLOYEE"),<br>odbc:disconnect(Ref),<br>
odbc:stop(),<br>X.<br><br>And I get is the infamous error:<br> {error,"Column type not supported"}<br>With the NR column there is no problem, but the other three columns return the same error message.<br>Can you tell me how you have solved the problem?<br>
<br>Alternatively please tell me if you know any other methods to access a posgresql database.<br>Thanks for your attention.<br>Best regards<br><font color="#888888">- Eugen Yu<br><br></font></blockquote></div><br><br clear="all">
<br>-- <br>Thanks & Regards,<br>S.Surindar </div>