Difference between revisions of "Orange: SQL Table"

From OnnoWiki
Jump to navigation Jump to search
Line 14: Line 14:
 
[[File:SQLTable-stamped.png|center|600px|thumb]]
 
[[File:SQLTable-stamped.png|center|600px|thumb]]
  
    Database type (can be either PostgreSQL or MSSQL).
+
Database type (can be either PostgreSQL or MSSQL).
 
+
Host name.
    Host name.
+
Database name.
 
+
Username.
    Database name.
+
Password.
 
+
Press the blue button to connect to the database. Then select the table in the dropdown.
    Username.
+
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.
 
 
    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.
 
  
 
##Installation Instructions
 
##Installation Instructions
Line 34: Line 28:
 
Install the backend.
 
Install the backend.
  
pip install psycopg2
+
pip install psycopg2
  
 
Alternatively, you can follow these instructions for installing the backend.
 
Alternatively, you can follow these instructions for installing the backend.
Line 44: Line 38:
 
Install the backend.
 
Install the backend.
  
pip install pymssql
+
pip install pymssql
  
 
If you are encountering issues, follow these instructions.
 
If you are encountering issues, follow these instructions.
  
##Example
+
==Contoh==
  
 
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.
 
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.
Line 54: Line 48:
 
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.
 
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
+
[[File:SQLTable-Example.png|center|600px|thumb]]
 +
 
  
  

Revision as of 08:17, 10 January 2020

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


Membaca data dari SQL database.

Output

Data: dataset from the database

Widget SQL mengakses data yang disimpan dalam database SQL. Widget SQL dapat terhubung ke PostgreSQL (memerlukan modul psycopg2) atau SQL Server (memerlukan modul pymssql).

Untuk menangani basis data besar, Orange mencoba untuk mengeksekusi bagian dari perhitungan di dalam basis data itu sendiri tanpa mengunduh data. Ini hanya berfungsi dengan database PostgreSQL dan membutuhkan ekstensi quantile dan tsm_system_time yang diinstal di server. Jika ekstensi ini tidak diinstal, data akan diunduh secara lokal.

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.

Contoh

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.

SQLTable-Example.png




Referensi

Pranala Menarik