cancel
Showing results for 
Search instead for 
Did you mean: 

Using `describe table` with `apoc.load.jdbc``

mckenzma
Ninja
Ninja

I am trying to use `describe table`  with `apoc.load.jdbc`  to pull information about SQL tables in a Neo4j query. Has anyone been able to do anything like this?

Example Query

 

CALL apoc.load.jdbc(<SQL connection string>, "
  describe table
") YIELD row

 

 

 

 

4 REPLIES 4

dana_canzano
Neo4j
Neo4j

@mckenzma  what database vendor is Neo4j connecting to via apoc.load.jdbc.   Are you able to get the same via a system table of said vendor, for example with Oracle one can query USER_TABLES so as to get similar data

I am pulling from Sybase SQL. Yes I can use `describe table`  to pull information about the columns and data types using an SQL client to query. 

@mckenzma  but can you query from `sysobjects`  and as described at https://stackoverflow.com/questions/1429898/from-a-sybase-database-how-i-can-get-table-description-f... to achieve the equivalent

I tried using 

SELECT sc.* 
FROM syscolumns sc
INNER JOIN sysobjects so ON sc.id = so.id

and got an error message: "Table name 'syscolumns' is ambiguous." If I try

SELECT * from sysobjects

then I see 2 entries: sysobjects & SYSOBJECTS

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.