swat.CAS.read_sql_table¶
-
CAS.
read_sql_table
(table_name, con, casout=None, **kwargs)¶ Read SQL database table into a CAS table
This method calls pandas.read_sql_table() with the given arguments, then uploads the resulting pandas.DataFrame to a CAS table.
Parameters: - table_name : string
Name of SQL table in database.
- con : SQLAlchemy connectable (or database string URI)
Database connection.
- casout : string or CASTable, optional
- The output table specification. This includes the following parameters.
- name : string, optional
Name of the output CAS table.
- caslib : string, optional
CASLib for the output CAS table.
- label : string, optional
The label to apply to the output CAS table.
- promote : boolean, optional
If True, the output CAS table will be visible in all sessions.
- replace : boolean, optional
If True, the output CAS table will replace any existing CAS. table with the same name.
- **kwargs : any, optional
Keyword arguments to pandas.read_sql_table().
Returns: See also
Notes
The data from the database will be pulled to the client machine in the form of a pandas.DataFrame then uploaded to CAS. If you are moving large amounts of data, you may want to use a direct database connecter from CAS.
Examples
>>> conn = swat.CAS() >>> tbl = conn.read_sql_table('iris', dbcon) >>> print(tbl.head())