Questions tagged [sql]

Tag for all questions about getting a connection to, setting up, or accessing a SQL database using Mathematica, particularly (but not restricted to) using Mathematica's DatabaseLink package.

Filter by
Sorted by
Tagged with
3 votes
0 answers
58 views

Entity Framework for Relational Databases is compiling `If` and `Which` statement incorrectly

Suppose I have an SQLite Database with a table name myTable. Then running the following query: ...
user13892's user avatar
  • 8,973
3 votes
1 answer
295 views

JAVA error NoSuchFieldException: usr_paths with OpenSQLConnection after installing 13.2

I performed a fresh install of Mathematica 13.2. The first code that I tried worked just fine under 13.0. It opens an SQL server connection using single sign-on (SSO) for my credentials. However, in ...
Sjoerd C. de Vries's user avatar
1 vote
1 answer
130 views

JDBC::error when connecting to MySQL database

I'm trying to connect to a MySQL database. I've seen quite a few different methods (some of which are conflicting and seem to be outdated) of connecting but haven't managed to get any to work so far. ...
wmv's user avatar
  • 359
1 vote
0 answers
115 views

How to specify table names in DatabaseLink for access database that have spaces in the names?

I am able to establish the connection with the access database as follows: ...
user13892's user avatar
  • 8,973
6 votes
0 answers
119 views

Who broke the JDBC?

For the last 10 years or so, I have been accessing the tables of a PostgreSQL database successfully. Suddenly, having upgraded to Version 13.0, I get error messages in the simplest of queries, such as ...
Matthias's user avatar
  • 343
1 vote
0 answers
51 views

Are Experimental Functions like DatabaseReference not available on Mathematica for Raspberry Pi?

I tried calling DatabaseReference and RelationalDatabase on version 12.3.1.0 for the Raspberry Pi, and found that the functions were not defined. I see in the documentation that they are Experimental ...
Stephen Wilkus's user avatar
0 votes
1 answer
64 views

Querying ( e.g. ) Google Trends Data with Mathematica front-end

Mathematica has some excellent data query and analysis methods, but can also perform as a front-end to an SQL database. Having worked as an SQL DBA in the past I would like to investigate further what ...
nilo de roock's user avatar
0 votes
0 answers
75 views

Failure connecting local MySQL server

I have locally installed and run the latest version of Oracle MySQL Community Server 8.0 on port 3306. I successfully established connections to it from locally installed Oracle MySQL Workbench 8.0 ...
Alexey Popkov's user avatar
2 votes
1 answer
135 views

OpenSQLConnection fails - due to some Java problem?

After upgrading to 12.3, I can no longer connect to an MS SQL Server using OpenSQLConnection. Apparently due to some problem with Java(?). I tried to reinstall JRE 8, but no change. DatabaseExplorer[] ...
HJensen's user avatar
  • 517
0 votes
0 answers
108 views

Wolfram Mathematica 11 and MS SQLServer 2019

I'm trying to connect with Wolfram Mathematica 11 to Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)(Build 19042: ). I'm unable to do it, and I don't find the documentation for that task. I tried ...
Teodoro Marinucci's user avatar
4 votes
2 answers
239 views

Problems with OpenSQLConnection on Mathematica 12.2 (Linux)

I used Mathematica to access the data of a MariaDB MySQL database. Within the version 12.0 it worked well on linux using the following code: ...
Tschibi's user avatar
  • 857
9 votes
1 answer
222 views

Generating Google BigQuery API Access Token in Wolfram Language

I'm working on a Wolfram Language Package to connect into Google Bigquery (that I'll make public available). In order to finish It, I need to solve a last step, that is how to get an authentication ...
Murta's user avatar
  • 26k
0 votes
0 answers
160 views

How to write to a VARBINARY field using a stored procedure

Is it possible to write a binary file (e.g. an EMF) to a VARBINARY field using a stored procedure? Creating an example EMF ...
Chris Degnen's user avatar
  • 30.6k
5 votes
0 answers
132 views

Speeding up postgres queries in v12.1?

New in v12.1 is the ability to connect to Postgres. I have a Postgresql database with a few million images (stored as byte data). Each image retrieval is ~10 seconds, so I need to speed it up! But how ...
M.R.'s user avatar
  • 31k
2 votes
0 answers
95 views

subquery doesn't work with SQLExecute

I want to select, say, rows 6 through 12 of a sqlite database. So I tried a subquery, but it does not work: ...
Scott Crittenden's user avatar
6 votes
1 answer
270 views

How to connect to MSSQL 2017 from Mathematica 12?

I'm wondering if it's possible to how to connect to MSSQL 2017? I am running Mathematic 12 on Windows 10 x64. Verified MSSQL was working perfectly using SSMS. Everything worked perfectly (as it has ...
Contango's user avatar
  • 463
8 votes
1 answer
261 views

How to do a database query on substrings?

With the package DatabaseLink I can open a connection to my MYSQL database. Then I can use SQL commands like ...
Fred Simons's user avatar
  • 10.1k
2 votes
0 answers
64 views

How to use SPARQLExecute for SPARQLSelect on Entities?

When using SPARQLSelect on Entity Types the entire entity store is downloaded to the local cache. For example, ...
Edmund's user avatar
  • 41.5k
4 votes
1 answer
189 views

How to use SPARQLSelect filter (SPARQLEvaluation["CONTAINS"]) on two named graphs?

I would like to match triplets from two graphs in a RDFStores on the string value of one containing the string value of the other. To test this I made the ...
Edmund's user avatar
  • 41.5k
2 votes
0 answers
82 views

SQLSelect - Bit (true/false) as condition

I have a table in a MySQL-DB which is of datatype "bit". The name of this column is "abk". If I write the following statement: ...
JJJanezic's user avatar
  • 277
1 vote
2 answers
73 views

Insert a DateObject into MySQL database?

I want to use Mathematica to do some SQL tasks like insert. However, I have difficulty in inserting date into SQL. Here is an example. ...
407PZ's user avatar
  • 1,431
7 votes
0 answers
223 views

Benefits of using the high level entity framework over raw SQL

Has anyone that has used both SQL particularly TSQL used in Microsoft SQL Server and Wolfram Database integration into its Entity framework, provide some particular examples where the high level ...
user13892's user avatar
  • 8,973
12 votes
2 answers
1k views

How to extract Bitmap image from SQL records?

I'm trying to extract image from records of the MSSQL demo database NorthWind with this codes, ...
Jerry's user avatar
  • 2,399
4 votes
3 answers
706 views

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

I have upgraded my MySQL database to 8.0. I downloaded its java connector, and moved mysql-connector-java-8.0.12.jar to : /Applications/Mathematica.app/Contents/SystemFiles/Links/DatabaseLink/Java/ ...
user34018's user avatar
  • 869
1 vote
3 answers
142 views

How to convert DateList format to standard SQL format?

I have a date in standard SQL format YYYY-MM-DD HH:MM:SS.xx, where the xx are hundredths of seconds: x = 2016-05-30 11:58:46.84 I have a file with 200,000+ ...
pdini's user avatar
  • 475
1 vote
0 answers
78 views

Probable Bug in SQLColumn condition < upper limit for SQLSelect

I have a perfectly good SQLSelect query that doesn't work if and only if it contains an extra < condition on a column already used. Details follow... This SQLselect shows that the expected data ...
Julian Moore's user avatar
  • 2,560
1 vote
1 answer
118 views

How do I visualize images stored in SQL?

here is the background: I have a SQL database that (among other data) contains images I connect to the database, extract and store the relevant data in variable picData like so ...
Guaro's user avatar
  • 25
3 votes
1 answer
331 views

Maintaining SQLConnections

I'm using SQLConnection to database in repetitive ScheduledTask. To prevent creation of new connections, and to maintain binding ...
Dragutin's user avatar
  • 900
3 votes
3 answers
475 views

Conditional selection of rows from a dataset

How can one select rows "a" and "b" from the following dataset where "b" values are larger ...
Miladiouss's user avatar
  • 1,833
0 votes
0 answers
109 views

SQL export data

I have data imported from excel file into mathematica but mathematica automatically converts large number into scientific form and when transferring this data to sql string field i get the following .....
user13892's user avatar
  • 8,973
3 votes
1 answer
6k views

JDBC with "autoReconnect=True"

I sometimes leave long computations running overnight and return in the morning to find that my database connection has timed out. I typically have to kill the kernel and launch a new database ...
Michael Stern's user avatar
4 votes
0 answers
100 views

Mathematica not releasing RAM

The following code is supposed to sequentially read data from a large CSV file and put it row by row into an SQL server. Although I thought RAM consumption should be constant the system keeps asking ...
user13892's user avatar
  • 8,973
0 votes
0 answers
388 views

Is it possible when creating an exe file from Mathematica code to include functions that create windows? [duplicate]

I'm building a program that uses SQL code to import live data, and uses said data to calculate basic SPC limits. This data is then graphed in a separate window. My final goal is to be able to turn ...
HaschelSmithers's user avatar
1 vote
0 answers
41 views

Oracle XML data select in SQLExecute Statement

Following query is returning null in Mathematica. t = "select xmlelement(\"test\",1) as test from dual"; SQLExecute[conn, t] It should retrun 1 as result but it is returing NUll value. How can I ...
Manoj's user avatar
  • 23
1 vote
0 answers
36 views

How to export result from SQLResultSet into a csv

I have a sql query which produces very large data from a remote server but the data is too large to fit into memory all at once. So i want to read and export it sequentially into a csv. I am using the ...
user13892's user avatar
  • 8,973
0 votes
0 answers
113 views

Query SQL database from within Manipulate in cdf?

As example, the following very simple code works fine when I run it from Mathematica .nb, but fails to get the data from SQL when I create an (Enterprise) cdf from it: ...
Conrad's user avatar
  • 713
8 votes
1 answer
168 views

Why has this SQLInsert behaviour changed?

Using Mathematica 11.1 to insert into a MySQL table with this schema... ...
Chris Degnen's user avatar
  • 30.6k
2 votes
1 answer
196 views

Connection to SQL server - Failed

I have a test database created by the colleagues from IT department and I can also access / see it using MS SQL Server Management Studio 2016. However, I cannot establish a connection to it from ...
Conrad's user avatar
  • 713
2 votes
0 answers
105 views

SQL Group By using SQLSelect

I would like to use the SQLSelect[] function in Mathematica 11 to get aggregated data from a large database. Is using SQLExecute ...
finetuned's user avatar
0 votes
2 answers
62 views

SQLInsert SQLExpr not working in V11

This worked fine in Mathematica 7. Any ideas how to fix it for version 11? ...
Chris Degnen's user avatar
  • 30.6k
1 vote
0 answers
45 views

Integer data type mapping problem with SQLInsert in DatabaseLink package

I am working with a following SQL table named "ticket". Now let's see the data types for the columns. ...
PlatoManiac's user avatar
  • 14.6k
11 votes
3 answers
2k views

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

Connecting to our corporate SQL servers using JDBC never worked for me, perhaps related to the Windows Authentication method that is necessary in our network. However, I found out that configuring the ...
Sjoerd C. de Vries's user avatar
2 votes
1 answer
96 views

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

I have a loop which performs SQLConnections and fetches data. Sometimes, I get an error due to overhead limit with a message saying ...
Basheer Algohi's user avatar
2 votes
0 answers
72 views

Mathematica: change x^y to power(x,y) [closed]

MySql does not understand the operator "^", i.e., we must use power(x,y) instead of x^y. How to translate x^y to power(x,y)?. Thanks César Lozada
César Lozada's user avatar
2 votes
1 answer
427 views

I have a communications link failure with JDBC MySQL(Connector/J)

I am unable to connect to my local mysql server using Mathematica. ...
Nigel King's user avatar
1 vote
0 answers
78 views

running the mathematica script in SQL Server

Hi i am trying to learn mathematica. I am following instruction in one of the questions asked before and did the following: In SQL Server a stored procedure is created as follows: ...
user13892's user avatar
  • 8,973
1 vote
0 answers
91 views

Using MemberQ or Contains* in a query fails

Using MemberQ or Contains* in a query fails: ...
M.R.'s user avatar
  • 31k
4 votes
1 answer
305 views

How do I insert Unicode into a MySQL database?

I'm having trouble transferring Unicode strings from one MySQL database to another using DatabaseLink` functions. Here is my failed attempt to read a string from ...
Ben's user avatar
  • 141
2 votes
0 answers
73 views

ParallelDo issue with SQLExecute (SQLite) [closed]

This code run as expected if I use Do[...], but if I use instead ParallelDo[...], as in the code bellow, the SQL INSERT statements seems to be completely ignored. In both cases, the filename is ...
jss's user avatar
  • 405
2 votes
0 answers
228 views

Random sample from sql database uniformly over time [closed]

I'd like to sample rows from a table uniformly over time, here is the naive way to do this: SELECT * FROM table ORDER BY RAND() LIMIT 10000 Unfortunately, ...
M.R.'s user avatar
  • 31k