Questions tagged [databaselink]

DatabaseLink is a toolkit for working with SQL databases built into Mathematica.

DatabaseLink is a toolkit for working with SQL databases built into Mathematica. It provides an industrial-strength, ready-made solution for integrating Mathematica with any standard SQL database. Among its functions are those for opening and closing connections to a database, fetching details about the organization of the database, as well as searching, inserting, and deleting data from the database.

Check:

104 questions
19
votes
1 answer

DatabaseLink and Libreoffice odb

Preface In scientific projects, I often deal with large Excel files from partners as this is unfortunately still the way to store data. Always, one of my first steps after importing the data is to verify and check the consistency of all…
halirutan
  • 112,764
  • 7
  • 263
  • 474
9
votes
1 answer

How can I connect to a database using the 32 Bit ODBC on a Windows 7 (64 Bit) machine?

I am having difficulties using a DSN that was defined in the 32 Bit version of the ODBC-manager? (there are two separate managers for 32/64 Bit on a 64 Bit machine) Using the DatabaseLink package will give an error as the DSN is not found and…
gwr
  • 13,452
  • 2
  • 47
  • 78
7
votes
1 answer

Complex queries to MS SQL Server

I'm using DatabaseLink to query MS SQL Server with SQLExecute which works totaly fine, for ex.: SQLExecute[conn, "declare @dt date; select * from ttable where date=@dt"] However the problem starts when i try to use table variable and try to return…
iav
  • 2,006
  • 17
  • 26
7
votes
2 answers

Connecting to Microsoft SQL with version 10

After upgrading to version 10, functions relying on a connection to a Microsoft SQL database no longer work. When I attempt to open a connection with something like: Needs["DatabaseLink`"] conn = OpenSQLConnection[JDBC["Microsoft SQL Server(jTDS)",…
mdeceglie
  • 968
  • 4
  • 14
6
votes
3 answers

Correct behavior of lock file in hsqldb connection

I'm running in to some problems with generating a persistent HSQLDB and during some troubleshooting I came upon the following behavior. Needs["DatabaseLink`"] tc = OpenSQLConnection[ JDBC["hsqldb", ToFileName[Directory[], "temp"]], Username ->…
bobthechemist
  • 19,693
  • 4
  • 52
  • 138
6
votes
2 answers

What is the quickest way to convert a lot of SQLDateTime[] objects to DateLists

I often run database queries that return sets of {date, datum} objects. A hypothetical query looks like testData = SQLExecute[commodDB, "select date,price from commoddb.tbcommodprices where futurePrefix='XB'"]; and the results look…
Michael Stern
  • 4,695
  • 1
  • 21
  • 37
4
votes
1 answer

Can't connect to MS SQL using Active Directory Integrated Services via DatabaseLink

We have a data lake in here that uses MS SQL Server 12.02 and connects using the active directory integrated services authentication. The standard driver would not work << "DatabaseLink`" sqlStandard = SQLConnection[ JDBC["Microsoft SQL…
Zviovich
  • 9,308
  • 1
  • 30
  • 52
3
votes
2 answers

Handling error in database connection (TimeConstrained)

I have a lot of scripts that use a database connection, and I have realized that my code should be protected against errors in my connection. For example, when my database is out for some technical reason. I tried to use this in a fake broke…
Murta
  • 26,275
  • 6
  • 76
  • 166
3
votes
1 answer

How to select a SQLConnection from SQLConnections[] by its "Name" property?

When creating a SQLConnection you can give it a name with the "Name" option. The connections are also added to the output of the SQLConnections function. OpenSQLConnection[ JDBC["HSQL(Standalone)", ToFileName[{$TemporaryDirectory, "SE Question"},…
Edmund
  • 42,267
  • 3
  • 51
  • 143
2
votes
0 answers

How to identify primary keys in an existing database table

I would like to identify the primary keys in a DB table using DatabaseLink commands trying to exclude SQLExecute. It seems like SQLTableInformation or SQLColumnInformation may not show that information.
Ariel Sepulveda
  • 1,687
  • 10
  • 20
2
votes
1 answer

Is there a way to define primary keys using SQLCreateTable?

I would like to create a db table and specify the primary key columns using the command SQLCreateTable. I know I could use SQLExecute but in this case I'm only interested in the right parameters for SQLCreateTable.
Ariel Sepulveda
  • 1,687
  • 10
  • 20
2
votes
1 answer

DatabaseLink Example for DB2 and Mathematica

could someone please point me to good example on how to make a JDBC connection to an IBM DB2 database?
Rick QI
  • 23
  • 2
1
vote
0 answers

Need a recommendation for managing a database link

I want to make a package which needs to have a external database link. But it is hard for me to have an idea about how to manage the database link. I want the link to be connected as long as I use the package and there must be only one link and…
Y. Kwon
  • 565
  • 2
  • 8
1
vote
0 answers

SQLDateTime from a time column is missing the milliseconds component

Can anyone confirm this? I am using M9.0.1 on win7 64bit connecting to a SQL Server db. When I fetch a datetime column the SQLDateTime objects contain 6 entries, 5 integers and a fractional second component. When I fetch a date the SQLDateTime…
Ymareth
  • 4,741
  • 20
  • 28
1
vote
1 answer

Multi-table SQLSelects

I'm trying to figure out how these statements really work, and am having some trouble with the documentation (and the software!). Using the example publishers database (Mathematica 8), the following works fine (as…
rogerl
  • 4,209
  • 3
  • 27
  • 42
1
2