Date and time
1 2 |
|
1 2 |
|
{ {2012,10,23},{2,6,37} }
has a type sql_datetime
.
1 2 |
|
1 2 |
|
{ {2012,10,23},{2,6,37} }
has a type sql_datetime
.
Here we are connecting to MS SQL Server 2008 on MS Windows XP from Erlang on Debian Linux.
Install utilities (FreeTDS SQL client):
1
|
|
Try to connect with the tsql
command from the freetds-bin
package:
1
|
|
or (with actual values for me):
1 2 3 4 5 |
|
If you see the counter (1, 2, 3, …), most likely tsql is unable to connect to the indicated server. Check the firewall’s settings.
sqsh
is an alternative for tsql
(more powerful).
Install the ODBC client driver.
1
|
|
tdsodbc
uses unixodbc
library, that conflicts with libiodbc2
. libiodbc2
is a dependency for soprano, that is a dependency for the most of KDE applications.
So, you cannot use the KDE and UnixODBC in Debian (the bug from 2011 year).
This conflict can be fixed, downloading the patched versions of the packages from here:
1 2 |
|
If you don’t use KDE or the bug was fixed, skip this step.
Update the config files:
/etc/odbc.ini
1 2 3 4 5 6 7 |
|
/etc/odbcinst.ini
1 2 3 4 5 6 |
|
Test it:
1 2 |
|
Try it from Erlang:
1 2 3 4 5 6 |
|
Dializer is a static analysis tool. It uses Persistent Lookup Table for storing information. First of all, we need to build PLT:
1
|
|
It is time for a cup of coffee, because it will take about 20 minutes. Fortunately, it can be called only once.
The next step is only 3-minutes long, but it will be called regularly. This command will show the errors:
1 2 3 |
|
The parameters are:
-n
Skip the plt check when running Dialyzer. Useful when working with
installed plts that never change.It saves few seconds.
-nn
Bypass the native code compilation of some key files that Dialyzer
heuristically performs when dialyzing many files; this avoids the
compilation time but it may result in (much) longer analysis time.The native code compilation is slow. So, add this parameter to save time.
-pa
This parameter adds the code for parse transforms.
--src
Add the source code and few dependencies to analyze.
The errors in dependencies will be also shown.
To avoid linking with Xapian you can use a port:
1
|
|
C-port allows to use Erlang VM and Xapian in different memory spaces. If a port crashes, Erlang VM will be still alive.
But I think, it does not help to avoid GPL restrictions: the whole program will be a derivative work.
GPL is a sly license. :)