|
Database Updates
|
|
|
|
With built-in database connectivity, Maple allows engineers and scientists to quickly develop and deploy powerful applications that combine large enterprise databases with the state-of-the-art analysis and visualization tools of Maple. You can easily query, create, and update your databases in Maple, without any detailed SQL knowledge. Now in Maple 18, database
connectivity has been extended to also include native support for SQLite databases. SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. For more information about SQLite, refer to http://www.sqlite.org/
In the following example, we will use Maple's Database package to import population data from the G20 countries into a SQLite database, access the database, and produce population tables and charts.
|
Import Population Data from a .csv File into SQLite Database
|
|
>
|
|
>
|
|
|
Import Data File
|
|
>
|
|
>
|
|
|
|
Create in Memory Database
|
|
The Open command opens a new database connection.
| (1) |
|
|
Create Population Table
|
|
>
|
|
| (2) |
The Execute command executes a SQL statement using the provided database connection.
|
|
Insert Data Into Population Table
|
|
>
|
|
>
|
|
>
|
|
| (3) |
The Prepare command prepares a SQL statement for execution.
>
|
|
| (4) |
>
|
|
The Finalize command finalizes the prepared statement.
|
|
Read Data Back
|
|
>
|
|
| (5) |
>
|
|
| (6) |
FetchAll returns all of the rows of the prepared statement.
|
|
Plot Data for Population in Canada from 1975 to 1990
|
|
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
>
|
|
>
|
|
|
|
|
|
|
|
|