Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working with database using OpenSQLConnection-JDBC. I am able to fetch the data perfectly from the tables but I cannot get nor the names of the tables (using SQLTableNames) neither the column names (using SQLColumnNames). I tried also to work with the help examples; but I got same problem.

what could be the reason?

conn = OpenSQLConnection[ 
  "Username" -> "username", "Password" -> "password"]

eventsdata = SQLSelect[
  conn, "tablename",
  SQLColumn["columnname"] == somevalue]

where: IP= Ip address of the database, databasename=database name that I am connecting to, tablename=table name which I have it before, columnname=columns names of the table that I have it before, somevalue=value so that I can fetch some of the data.

share|improve this question
What command are you using to fetch the data? Can you show us the code that works? – mfvonh Jun 25 '14 at 4:22
@mfvonh I have add part of the code that works. – Algohi Jun 25 '14 at 4:50
What output do you get when you try these: SQLTables[conn], SQLTableNames[conn], SQLTableInformation[conn]? – mfvonh Jun 25 '14 at 4:52
I got all empty list {}. – Algohi Jun 25 '14 at 4:53
Try SQLExecute[conn, "use tablename"] and then SQLTables[conn]. (with a real table name of course) – mfvonh Jun 25 '14 at 4:58

I would suggest to use SQL directly. For Oracle databases the following module should work.

Module[{dbConn, sqlAct, records},
OpenSQLConnection["your connection"] // Set[dbConn, #] &;
SQLExecute[dbConn, sqlAct] // Set[records, #] &;
] // MatrixForm // Print;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.