Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Database toolbox details
Please login or create an account

Database toolbox

Connect to databases, execute queries, load data to/from DB from/to Scilab environment
(5265 downloads for this version - 13202 downloads for all versions)
Details
Version
0.1
A more recent valid version exists: 0.1.1
Authors
Igor Gridchyn
Sylvestre Ledru
Pierre Marechal
Allan Cornet
Owner Organization
private individual
Maintainers
Igor Gridchyn
Allan Cornet
Categories
License
Creation Date
May 12, 2011
Source created on
Scilab 5.2.x
Binaries available on
Scilab 5.2.x:
Windows 32-bit
Install command
--> atomsInstall("scidb")
Description
            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.            
Files (3)
[6.82 MB]
Source code archive
Archive with the toolbox.
[15.89 MB]
Windows 32-bit binary for Scilab 5.2.x
Windows 32-bit
Automatically generated by the ATOMS compilation chain

[34.51 kB]
Miscellaneous file
Scilab Enhancement Proposal for the toolbox.
News (0)
Comments (5)     Leave a comment 
Comment from Sascha Mench -- August 4, 2011, 11:01:13 AM    
Hello,

I want to connect with the toolbox to a MySQL-DB, but somehow it doesn't work or I do 
something wrong.

The look of my connection struct:

connStr =

   provider: "MYSQL"
   database: "scilab"
   user: "scilab"
   password: Password for user scilab
   host: Ip from the db
   port: Port from MySQL

Then I try to connect:

dblink = DbConnect(connStr)

Result is: dblink =            (is that correct, that dblink is empty?)

Then I want to show the tables with DbTables(dblink), but the result is the same:

ans =                           (instead of the tables which already exist)

When I call the last error with DbLastDbError(dblink), I get "Driver not loaded Driver
not 
loaded"

How can I get this work?

The demos are not helpful, because I get always "unknown provider: QQSQLITE"

I hope, someone can help me!

Best regards!
Comment from Josh Summitt -- September 22, 2011, 05:47:26 AM    
I've installed this toolkit from the scilab package manager and i can't get it to connect
to any database. The demo's don't even work even after changing the bug where QSQLLITE
should be just SQLLITE. I get the following errors:

conn = struct ("provider", "SQLITE", "database",
"C:\PROGRA~1\SCILAB~1.3\contrib\scidb\0.1-0\demos\addressbook")   
 
 Connecting to a database:   
 
 DbConnect(conn)   
 
 resultHandler = DbQuery("SELECT * FROM addressbook")   
Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "scidb" function.
Save your data and restart Scilab.
 
 DbDisconnect()   

-->dberr = DbLastDbError();
 
-->dberr 
 dberr  =
 
 Driver not loaded Driver not loaded   

please help!
Answer from Igor Gridchyn -- September 23, 2011, 04:13:34 PM    
Hi, Josh.

Please, send me an e-mail to igridchyn@gmail.com,
I will try to help you.

> I've installed this toolkit from the scilab package manager and i can't get it to
> connect
> to any database. The demo's don't even work even after changing the bug where
QSQLLITE
> should be just SQLLITE. I get the following errors:
> 
> conn = struct ("provider", "SQLITE", "database",
> "C:\PROGRA~1\SCILAB~1.3\contrib\scidb\0.1-0\demos\addressbook")   
>  
>  Connecting to a database:   
>  
>  DbConnect(conn)   
>  
>  resultHandler = DbQuery("SELECT * FROM addressbook")   
> Warning !!!
> Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
> with "scidb" function.
> Save your data and restart Scilab.
>  
>  DbDisconnect()   
> 
> -->dberr = DbLastDbError();
>  
> -->dberr 
>  dberr  =
>  
>  Driver not loaded Driver not loaded   
> 
> please help!
Answer from Yann Tanguy -- May 16, 2012, 04:58:56 PM    
I have the same error message as Josh Summitt, while attempting to connect to a database:
" Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "scidb" function.
Save your data and restart Scilab."

On Windows 7, Scilab 5.3.3 (32 bits), Mysql 5.5 server. And with the 64 bits Scilab
version this toolbox could not be loaded.

Any help greatly appreciated.
Comment from Mizue Horiuchi -- November 22, 2011, 08:05:25 PM    
Hi, I've tried the toolbox and got the same result as what Sascha did. I tried to connect
to 
MySQL and ODBC, but neither of them worked. 
Comment from Nair Gokul -- January 15, 2014, 07:53:51 AM    
Hi,



I am getting the error 999..  Unknown provider: for MYSQL.



Any help?



Leave a comment
You must register and log in before leaving a comment.
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.