Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Prerequisites

The Kyvos ODBC driver should be installed and configured on the computer where you want to use R to connect to the Kyvos semantic model.

Steps to connect to Kyvos using R

  1. Install R from the following link:
    https://cloud.r-project.org/

  2. Open R and run the following command to install the ODBC package.

    install.packages("odbc")

ODBC will be installed, as shown in the following figure.

image-20240326-053306.png
  1. Verify that ODBC recognizes the installed drivers using odbcListDrivers() command.

    library(odbc)
    sort(unique(odbcListDrivers()[[1]]))

Here’s a screenshot for reference.

Connection_R2.png
  1. Connect to Kyvos using the following command.

    con <- dbConnect(odbc::odbc(), driver = "Kyvos ODBC Driver", UserName = "username", PWD = "password", host = "192.168.8.190",  port=8081, HTTPPath = "kyvos/sql")
  2. Verify the above connection with the command below.

    dbIsValid(con)
    #Returns TRUE if connection is established else return FALSE.
  3. Run the queries using the following command.

    dbGetQuery(con,'Paste your SQL query here')
  4. After executing the queries close the connection using the dbDisconnect(con). command.

  5. Execute the dbIsValid(con) command to ensure that the connection is disconnected.

  • No labels