Shubh
Shubh

Reputation: 595

How to get list of all databases in vertica trough R?

I am making my connection in R and trying to get list of all databases present in vsql Database. My code is:

library(RJDBC)
##connection
conn <- dbConnect(drv, paste0("jdbc:vertica://",client.hostname,":5433/"),
                          user=client.username , password=client.password)
##Query
dbGetQuery(conn, "SELECT DISTINCT(table_schema) FROM v_catalog.tables;")

The above code returns only schema names

Upvotes: 1

Views: 562

Answers (1)

Shubh
Shubh

Reputation: 595

dbGetQuery(conn, "SELECT database_name FROM v_catalog.databases;")

Upvotes: 1

Related Questions