Same version as 0.1, but makes it available for 5.4.
The aim of this moculde is to add ability for database interaction to Scilab.
After connecting to a database, you can execute queries against it and perform
data exchange between Scilab environment and the database.
Supported database providers: PostgreSQL, Sqlite, MySQL, MSSQL, ODBC, Firebird.
To start work with db, connect to it using one of two versions of DbConnect:
Connection = DbConnect(provider, connectionString)
Connection = DbConnect(connectionStruct)
provider:
Type: String
Possible values: “PSQL”, “SQLITE”, “MYSQL”, “DB2”, “OCI”,
“ODBC”, “SQLITE2”, “TDS”
connectionString
Type: String
connectionStruct
Type: Struct
The fields of the struct are:
–provider (mandatory)
–host (optional)
–port (optionnal)
–database (optional)
–user (optional)
–password (optional)
The last database, to which connection was established becomes default. This
means, you do not have to provide a Connection object every time with further
queries to DB.
Examples:
DbConnect("postgresql", ..
"Server=127.0.0.1;Database=myDataBase;User
Id=myUsername;Password=myPassword;");
connexionStruct = struct();
connexionStruct.provider = "postgresql";
connexionStruct.database = "myDataBase";
connexionStruct.hostname = "127.0.0.1" ;
connexionStruct.use = "myUsername";
connexionStruct.password = "myPassword";
DbConnect(connexionStruct);
After connecting, you are able to execute queries and obtain a result handler,
which later can be used to aquire data using functions
DbFetch[All]{String|Real|Struct}:
resultHandle = DbQuery("SELECT * FROM data_table"); //default connection is
used
results = DbFetchReal(resulthandle); // results is a Scilab matrix
You will find a detailed description in SEP file or in help of the module.