# ODBC

You can quickly import data from your ODBC Database Connection into Exploratory.

## 1. Install ODBC Drivers and Set Up Data Source Name (DSN)

First, install ODBC Drivers and set up Data Source Name (DSN) for the database you want to connect Exploratory to. Following are instructions to create ODBC DSN for some of the types of databases we verified that they work.

* [Snowflake](https://exploratory.io/note/2ac8ae888097/How-to-import-data-from-Snowflake-nhP3FTm5ZM) (for Mac/Windows)
* [Oracle](https://exploratory.io/note/exploratory/Connecting-to-Oracle-Database-through-ODBC-from-Windows-with-Oracle-Instance-Client-LmR8nHr3) (for Windows)
* [Oracle](https://exploratory.io/note/exploratory/Connecting-to-Oracle-Database-through-ODBC-from-Mac-uvi2DuT5) (for Mac)
* [Oracle (Japanese)](https://exploratory.io/note/BWz1Bar4JF/Oracle-Instance-Client-Windows-ODBC-Oracle-Database-AGi5wIz7QG) (for Windows)
* [Oracle (Japanese)](https://exploratory.io/note/BWz1Bar4JF/ODBC-Mac-Oracle-Database-baR1tUK7KO) (for Mac)
* [Microsoft SQL Server](https://community.exploratory.io/t/connecting-to-ms-sql-server-through-odbc-from-windows/341) (for Windows)
* [Microsoft SQL Server](https://community.exploratory.io/t/connecting-to-ms-sql-server-through-odbc-from-mac/339) (for Mac)

## 2. Create a Connection to use

Select the "Data Connection" menu from the menu right next to the project name.

![](/files/-MRgc-0mZMh4oasxjBRw)

Click the "Add" button.

![](/files/-MRgc-0om4eHBH7DieAc)

Select the "ODBC" icon.

![](/files/-MRgc-0pMLyb2f3EMhsP)

Select the DSN created at Step 1 and click the Test and make sure it works.\
For Mac, we support both [iODBC](http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/ODBCMacOSX) based and [unixODBC](http://www.unixodbc.org/drivers.html) based ODBC Drivers and DSN.

![](/files/-MRgc-0sYFU-aNdcDMRQ)

Click the "Add" button to save the connection.

## 3. Open ODBC Import dialog

Click '+' button next to 'Data Frames' and select 'Database Data'.

![](/files/-M4oN-qBMezITjny_pQQ)

Click ODBC to select.

![](/files/-M4oN8dOXQmEdeuOsh0X)

## 4. Preview and Import

Click Preview button to see the data from your ODBC database connection.

![](/files/-M4oN8dQejGt1jX7I0An)

If it looks ok, then you can click 'Import' to import the data into Exploratory.

## 5. Using Parameters in SQL

First, click a parameter link on the SQL Data Import Dialog.

![](/files/-M4oN2yAtTsqxNt3r0_M)

Second, define a parameter and click Save button.

![](/files/-M4oN2yC4K_GmMFFjzoo)

Finally, you can use @{} to surround a variable name inside the query like below.

```
select *
from airline_2016_01
where carrier = @{carrier}
```

If you type @ then it suggests parameters like below.

![](/files/-M4oN2yEXevqQptAWUEl)

Here's a [blog post](https://exploratory.io/note/kanaugust/An-Introduction-to-Parameter-in-Exploratory-WCO4Vgn7HJ) for more detail.

## 6. Number of rows

From performance point of view, we no longer show actual number of rows which can be only fetched by executing whole query again.

![](/files/-M4oN66xWkcCxqo19jUZ)

If you still want to show the actual number of query for your query, you can do so by setting System Configuration.

![](/files/-M4oN66zCHttnANqtQHx)

Then set "Yes" For "Show Actual Number of Rows on SQL Data Import Dialog"

![](/files/-M4oN670aVGCuTHA4oG4)

This will show you Actual Number of Rows like below.

![](/files/-M4oN6725Fzzj5A208wn)

## 7. Known Issues

* [Importing multi-byte characters from Teradata Aster fails](https://exploratory.io/note/exploratory/How-to-workaround-known-issues-when-connectiong-to-Teradata-Aster-with-ODBC-BTG0Tmz9)
* [Schema and Tables are not shown for Kintone](https://exploratory.io/note/exploratory/How-to-workaround-known-issues-when-connecting-to-Kintone-with-ODBC-hjq9Deg4)
* [Unable to Connect to IBM DB2 with ODBC and it shows error message SQLAllocHandle failed at SQL\_HANDLE\_ENV.](https://community.exploratory.io/t/unable-to-connect-to-ibm-db2-with-odbc-and-it-shows-error-message-sqlallochandle-failed-at-sql-handle-env/3888)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.exploratory.io/data_import/database-data/odbc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
