Skip to main content
14 votes
Accepted

How to extract Bitmap image from SQL records?

Summary The Northwind database was originally an MS Access database, so the pictures are BMP images wrapped within OLE objects. We must strip the OLE header before parsing them. The following ...
WReach's user avatar
  • 69k
12 votes
Accepted

How to do a database query on substrings?

I am one of the developers for the new relational database connectivity features. Very soon, a rather extensive tutorial will be added to the current documentation (via documentation paclet update), ...
Leonid Shifrin's user avatar
8 votes

JDBC-to-ODBC bridge gone. How to connect to SQL Server now in case of Windows Authentication?

Following Rolf Mertig's tip I examined the merits of Microsoft's latest JDBC driver (not included in Mathematica 11). It worked, but it was quite a trip. The itenary can be found below. Note that you'...
Sjoerd C. de Vries's user avatar
7 votes
Accepted

Maintaining SQLConnections

Moving my comments into an answer: If you create forceConnection[conn_]:=If[.. then you don't have to worry about replacing conn...
Kuba's user avatar
  • 137k
7 votes
Accepted

Why has this SQLInsert behaviour changed?

It looks like a bug to me. Any input larger than 2^31 -1 is truncated to 32 bits, whereas a BIGINT should be able to hold 64 bit numbers. What you see is the interpretation of that remainder in two's ...
Sjoerd C. de Vries's user avatar
6 votes
Accepted

SQLite and Mathematica

DatabaseLink` and the Database` functions are actually two completely independent ways to access databases. The ...
Albert Retey's user avatar
  • 23.6k
6 votes

Graph databases / Nosql with Mathematica

Wolfram Language version 11.3 now has support for interfacing with MongoDB. You can connect to a MongoDB database via MongoConnect. For example, connecting to a ...
Sebastian's user avatar
  • 3,479
6 votes

How to connect to MSSQL 2017 from Mathematica 12?

Got it. Turn on TCP/IP in SQL Server Configuration Manager: ...
Contango's user avatar
  • 463
6 votes
Accepted

Generating Google BigQuery API Access Token in Wolfram Language

Google Cloud Platform uses the RS256 algorithm to send JWT and retrieve the tokens, all that is needed is to make a function that builds the JWT and creates a signature using ...
Cabral's user avatar
  • 138
5 votes

how to set up mySQL 8.0 J/ Connector drive in Mathematica?

I have a working MySQL 8.x configuration that I'd like to pass along. First, there are a few important MySQL configuration options we need to be aware of. A default MySQL 8.x server configuration ...
cjpembo's user avatar
  • 1,292
5 votes

JDBC-to-ODBC bridge gone. How to connect to SQL Server now in case of Windows Authentication?

Yes you are right, JDBC-to-ODBC support is gone as Mathematica uses java8. However 11.0.1 mathematica comes with a support for using open source JDBC driver which can be used to connect Microsoft ...
dsingh's user avatar
  • 669
5 votes

MySQL insert statement over remote server is extremely slow. How can I speed it up?

So finally I decided to create a BatchInsert[] functions that is 100 times faster than SQLInsert[]. This is the code: ...
elbOlita's user avatar
  • 1,681
4 votes

Add new JDBC Driver to connect Mathematica to SQL database

In the case where you want to use an updated driver in preference to an older one shipped with Mathematica, AddToClassPath[ ...path..., Prepend -> True]. For ...
Chris F Carroll's user avatar
4 votes
Accepted

How do I visualize images stored in SQL?

The leading byte sequence 255, 216, 255, 224 looks like the file header that one finds when an image is in JPEG File Interchange Format. To import such an image, we can use: ...
WReach's user avatar
  • 69k
3 votes
Accepted

Insert a DateObject into MySQL database?

You may use SQLDateTime with DateList. ...
Edmund's user avatar
  • 42.4k
3 votes
Accepted

How to convert DateList format to standard SQL format?

What about: DateString[ {2016, 5, 30, 11, 58, 46.84} , {"ISODate", " ", "Time", ".", "Millisecond", "000"} ] ...
Kuba's user avatar
  • 137k
3 votes

Skip iteration when SQL JDBC issues an error due to huge data fetching

If you have a potentially large amount of data that you need to process in batches then you may use Result Sets functions. These basically create and navigate a SQL cursor of your SQL ...
Edmund's user avatar
  • 42.4k
3 votes
Accepted

Connection to SQL server - Failed

The error message indicates that the server host name is in error. This is because the instance name has been tacked onto the end of server host name (wwe**pe.**.***.ds\MSSQL***). While this is ...
WReach's user avatar
  • 69k
3 votes

Conditional selection of rows from a dataset

You may have a good reason for your dataset structure, but the question as written seems to suggest a different structure (named columns instead of named rows) and thereby a simpler answer: ...
Alan's user avatar
  • 13.8k
3 votes

SQL-like computation on Dataset: Aggregate function

In addition to the excellent answer given by WReach I would like to show, how we can come up with the rectangular result the OP wants: ...
gwr's user avatar
  • 13.5k
3 votes

Importing SQL view vs table

In the question you do not specify which database driver you use to open the connection with JDBC. I have been experimenting with Microsoft Access Database drive and I had similar problems in the past....
Athanassios's user avatar
  • 1,301
3 votes

Problems with OpenSQLConnection on Mathematica 12.2 (Linux)

Thanks for reporting this. Unfortunately, Mathematica 12.2 has this bug but this should be fixed by the newer paclet release. For now, a workaround could be by using JDBC driver connection as below: <...
Dev's user avatar
  • 61
3 votes
Accepted

OpenSQLConnection fails - due to some Java problem?

I received the following from Wolfram and it worked for me: As a workaround, please try the following: Download Microsoft mssql jdbc driver zip fie from https://docs.microsoft.com/en-us/sql/connect/...
HJensen's user avatar
  • 537
2 votes

How do I insert Unicode into a MySQL database?

Based on this answer, I solved the issue by adding "Properties" -> {"characterEncoding" -> "UTF-8"} to the connection: ...
balping's user avatar
  • 438
2 votes

Importing SQL view vs table

You may use SQLTable in SQLSelect so that the table names are properly formatted for the database system you are using. ...
Edmund's user avatar
  • 42.4k
2 votes

Conditional selection of rows from a dataset

How about one of these two options? Two simple queries: dataset[{"a", "b"}][{"b" -> Select[Greater[#, 8] &]}] One slightly more complicated query: ...
Sjoerd Smit's user avatar
  • 23.7k
2 votes

Conditional selection of rows from a dataset

This will give the desired result: result = dataset[ {All, Position[#b, b_ /; b > 8]&} /* (Query[{"a", "b"}, #[[2, All, 1]]][#[[1]]]&) ] .....
WReach's user avatar
  • 69k
2 votes

how to set up mySQL 8.0 J/ Connector drive in Mathematica?

Obtained the up-to-date mysql-connector-java-8.0.19.jar from https://dev.mysql.com/downloads/windows/installer/8.0.html Copied to ...
Chris Degnen's user avatar
2 votes

how to set up mySQL 8.0 J/ Connector drive in Mathematica?

...
dvand's user avatar
  • 29
2 votes

Insert a DateObject into MySQL database?

As it turns out, DateObject is not the only problem here. I kind of lack in some basic knowledge in SQL. Here are the mistakes I made. ...
407PZ's user avatar
  • 1,461

Only top scored, non community-wiki answers of a minimum length are eligible