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.

107 questions
7
votes
1 answer

SQL JDBC Zerodatetime

I am trying to query SQL data with MATHEMATICA - however, the MySQL database contains zerodates and that leads to the following error message: e.g. (1) *SQLSelect[conn, "orders", {"time_created"}, MaxRows -> 5]* --> JDBC::error: "!(\"Cannot convert…
Patrick Bernhard
  • 707
  • 5
  • 12
6
votes
1 answer

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 for the past 5 years). Tried this, no…
Contango
  • 463
  • 1
  • 3
  • 10
4
votes
0 answers

Create SQL Database on a manually specified directory

I am inserting lots of data into the preinstalled SQL Database in MM: con= OpenSQLConnection["demo"] > SQLCreateTable[con, SQLTable["anyname"], SQLcolums] > ... I am running out of disk space on my laptop, so I would love to create an SQL Database…
Patrick Bernhard
  • 707
  • 5
  • 12
4
votes
3 answers

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/ Set CLASSPATH to make sure it can be found I went…
user34018
  • 869
  • 6
  • 10
3
votes
1 answer

Running postgresql query with backslash

I've been able to connect to a Vertica database, and also been able to run a SELECT query. But I'm not being able to run a query with a backslash in it. (Vertica has commands like postgresql.) The command I'm trying to run is \d;. I've tried…
mohit6up
  • 281
  • 1
  • 4
3
votes
1 answer

mysql insert set problem

I need some help. set = {0, 0}; Print[set]; Needs["DatabaseLink`"]; JDBCDrivers["MySQL(Connector/J)"] conn = OpenSQLConnection[ JDBC["MySQL(Connector/J)", "localhost:3306/test"], "Username" -> "root", "Password" ->…
user5356
  • 41
  • 1
2
votes
1 answer

Using SetDelayed wih SQLExecute

I want to create a reusable line of code that I can send a column, table name and criteria to match using the WHERE clause. colCount[x_, y_, z_] := Length[SQLExecute[conn, "SELECT " && x && " FROM " && y && " WHERE " && x && " = " && y && …
Sinistar
  • 1,029
  • 1
  • 10
  • 19
2
votes
1 answer

Connecting to a SQL Server Instance

What is the syntax for connecting to a specific instance of a sql server database? Here's my code: Needs["DatabaseLink`"]; conn1 = OpenSQLConnection[ JDBC["Microsoft SQL Server(jTDS)", "ARC-WEB/SKWSPATIAL"], "UserName" -> "Mathematica",…
TheHiker
  • 81
  • 2
2
votes
1 answer

SQL Queries with the Table function

Given the following connection to an SQL query works but the data comes out wrong: data = Table[SQLSelect[conn, "All", {"col1", "col2"}, SQLColumn["col1"] == n && SQLColumn["col2"] == o], {n, 1, 8}, {o, 21, 30}]; If I do not use the…
Sinistar
  • 1,029
  • 1
  • 10
  • 19
2
votes
0 answers

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: SQLExecute[conn,"SELECT * FROM (SELECT row_number() OVER (ORDER BY id) AS RowNum, * FROM chains) WHERE (6 <= RowNum AND RowNum <= 12);" and…
2
votes
0 answers

Mathematica: change x^y to power(x,y)

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
1
vote
0 answers

Login failed with Windows account into sql server using mathemcatica

I am trying to make a connection from WOLFRAM- MATHEMATICA to an SQL server database. When I tried with my windows authentication, I am getting an error saying login failed for user, but when I tried with SQL authentication account it is working…
1
vote
1 answer

OrientDB JDBC OpenSQLConnection : Execution of SQL failed

I am testing JDBC connection of OrientDB v2.0.13 from Wolfram Language. Needs["JLink`"] AddToClassPath["C:\\OrientDB2013\\jdbc\\orientdb-jdbc-2.0.13-all.jar"]; Needs["DatabaseLink`"] conn = OpenSQLConnection[ JDBC[ …
Athanassios
  • 1,291
  • 10
  • 22
1
vote
0 answers

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 rertive xml data stored in the database using…
Manoj
  • 23
  • 2
0
votes
1 answer

Selective update of mySQL database column

I would like to update several entries in a mySQL database which I use in combination with Mathematica. But the following code does not work: Map[ SQLUpdate[conn, "table_name","column2update", {1}, SQLColumn["selection_column"] = #" ]…
Phadreus
  • 461
  • 2
  • 10
1
2