Orange: SQL Table

From OnnoWiki
Revision as of 08:09, 10 January 2020 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/sqltable.html


Reads data from an SQL database.

Outputs

   Data: dataset from the database

The SQL widget accesses data stored in an SQL database. It can connect to PostgreSQL (requires psycopg2 module) or SQL Server (requires pymssql module).

To handle large databases, Orange attempts to execute a part of the computation in the database itself without downloading the data. This only works with PostgreSQL database and requires quantile and tsm_system_time extensions installed on server. If these extensions are not installed, the data will be downloaded locally.

../../_images/SQLTable-stamped.png

   Database type (can be either PostgreSQL or MSSQL).
   Host name.
   Database name.
   Username.
   Password.
   Press the blue button to connect to the database. Then select the table in the dropdown.
   Auto-discover categorical variables will cast INT and CHAR columns with less than 20 distinct values as categorical variables (finding all distinct values can be slow on large tables). When not selected, INT will be treated as numeric and CHAR as text. Download to local memory downloads the selected table to your local machine.
    1. Installation Instructions
      1. PostgreSQL

Install the backend.

pip install psycopg2

Alternatively, you can follow these instructions for installing the backend.

Install the extensions. [optional]

      1. MSSQL

Install the backend.

pip install pymssql

If you are encountering issues, follow these instructions.

    1. Example

Here is a simple example on how to use the SQL Table widget. Place the widget on the canvas, enter your database credentials and connect to your database. Then select the table you wish to analyse.

Connect SQL Table to Data Table widget to inspect the output. If the table is populated, your data has transferred correctly. Now, you can use the SQL Table widget in the same way as the File widget.

../../_images/SQLTable-Example.png



Referensi

Pranala Menarik