Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Database toolbox details
Login with GitLab

Database toolbox

Connect to databases, execute queries, load data to/from DB from/to Scilab environment
(9756 downloads for this version - 15720 downloads for all versions)
Details
Version
0.1.1
Authors
Igor Gridchyn
Sylvestre Ledru
Owner Organization
private individual
Maintainer
Igor GRIDCHYN
Categories
License
Creation Date
January 9, 2013
Source created on
Scilab 5.4.x
Binaries available on
Scilab 5.4.x:
Windows 32-bit Linux 32-bit Linux 64-bit
Install command
--> atomsInstall("scidb")
Description
            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.            
Files (4)
[6.81 MB]
Source code archive
makes it available for linux 32 and 64, and for 5.4.0 version
[6.93 MB]
Windows 32-bit binary for Scilab 5.4.x
Windows 32-bit
Automatically generated by the ATOMS compilation chain

[6.83 MB]
Linux 32-bit binary for Scilab 5.4.x
Linux 32-bit
Automatically generated by the ATOMS compilation chain

[6.83 MB]
Linux 64-bit binary for Scilab 5.4.x
Linux 64-bit
Automatically generated by the ATOMS compilation chain

News (0)
Comments (11)     Leave a comment 
Comment from Martin Stricker -- July 17, 2013, 07:21:40 PM    
I tried to connect to a odbc datasource.
The connection string I use works fine in other programming languages like VBA.
When I use the string on DbConnect it is not possible to establish a connecten whereas no 
error message gets returned by DdConnect.

Skript:
connStr=struct('provider', 'ODBC','database','DRIVER={AspenTech SQLplus};ADS=IP21_V');
DbConnect(connStr);
test=DbQuery("Select name form iogetdef");
Returns:
Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "scidb" function.
Save your data and restart Scilab.

Using:
connStr=struct('provider', 'ODBC','database','DRIVER={AspenTech SQLplus};ADS=IP21_V');
c=DbConnect(connStr);
test=DbQuery(c,"Select name form iogetdef");
Returns:
test=DbQuery(c,"Select name form iogetdef");
                                            !--error 999 
The connection is not opened!at line       5 of exec file called by :    
exec('C:\TEMP\scidb_0.1.1\demos\test.sce', -1)

Is it not possible  connect to SQLplus by using ODBC or am I doing something wrong?

Tank you very much! 
Comment from Stefan Droege -- August 26, 2013, 04:07:49 PM    
A note for everyone not finding the Database Toolbox in the Scilab Atoms GUI: You need to
have the 32bit version of Scilab installed. 
Otherwise the package is not listed in the ATOMS GUI and trying to install it leads to an
error ("atomsInstallList: The package scidb is not available.")
Comment from Bernd Mayer -- October 2, 2013, 07:21:38 PM    
Dear SciLabbers,

I have recently tried to implement the scidb toolbox. Unfortunately I was not able to get
it running. I would be very happy I you have any comments for me

When I run the following two command:
   atomsLoad("scidb")
   dblink = DbConnect("ODBC", "Server=127.0.0.1;Database=XXXXXXXX;User
Id=YYYYYYYY;");

I get the following error:
         !--error 999 
   Unknown provider: ODBC

I run SciLab 5.4.1 and tried it both, on a Windows XP and Windows 7 computer.
I am sure that the ODBC connection is up and running. The driver is "SQL
Server";

According to the help entry of dbconnect ("help dbconnect") the provider ODBC is
available.

Thank you very much!
Comment from Nair Gokul -- January 15, 2014, 07:54:35 AM    
Hi,







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







Any help?

Answer from Philippe Couty -- June 2, 2014, 01:53:59 PM    
Hi, did you get your answer for "Unknown provider : MySQL "
Thanks
Comment from David Frost -- February 25, 2014, 12:05:17 PM    
Hi 

I am having a similar problem to previous posts, trying to connect via ODBC. Has anyone
found a solution or is the ODBC option not working?

***
-->cnx=struct();

-->cnx.provider="ODBC"
 cnx  =
   provider: "ODBC"

-->cnx.database='DRIVER={SQL Server Native Client
10.0};SERVER=dpf-e5410;DATABASE=cdb41;Trusted_Connection=Yes;'
 cnx  =
   provider: "ODBC"
   database: "DRIVER={SQL Server Native Client
10.0};SERVER=dpf-e5410;DATABASE=cdb41;Trusted_Connection=Yes;"
 
-->DbConnect(cnx)
 ans  =
 
-->dbe = DbLastDbError()
 dbe  =
 Driver not loaded Driver not loaded 

-->DbQuery("select * from codeMarital");
Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "scidb" function.
Save your data and restart Scilab.

***
So DbConnect is not loading the driver which obviously leads the critical error.

Any help gratefully received.
Comment from mlier mlier -- July 28, 2014, 06:27:16 PM    
Hi,

when I ask the following Internet address :

http://forge.scilab.org/index.php/p/scidb/



I get the error : 

====
You are not authorized to view this page. You do not have permission
to view the requested directory or page using the credentials supplied.

403 - Forbidden
====

Seems not to be normal !
Comment from mlier mlier -- July 28, 2014, 06:28:30 PM    
Hi, 

is that module is planned on Mac OS ? 
Would be very useful !
Answer from Samuel Gougeon -- June 11, 2015, 12:55:16 AM    
> is that module is planned on Mac OS ? 
> Would be very useful !

Right, as well as on Windows 64 bits, on which it presently refuses to run, with a proper
message telling the unsupported architecture. A pity.
Answer from David Chèze -- January 7, 2021, 02:16:58 PM    
> > is that module is planned on Mac OS ? 
> > Would be very useful !
> 
> Right, as well as on Windows 64 bits, on which it presently refuses to run, with a
> proper
> message telling the unsupported architecture. A pity.

Hi,
did you get any support for WIN 64bits architecture? I'm also experiencing issue when 
compiling the src after minor adjustments of builders for scilab 6.

any feedback welcome !

Thanks,
David  
Answer from Samuel Gougeon -- January 7, 2021, 06:37:28 PM    
> Hi,
> did you get any support for WIN 64bits architecture? I'm also experiencing issue when

> compiling the src after minor adjustments of builders for scilab 6.

Unfortunately no, i did not. I did not insist.
Comment from Pascal Buehler -- September 19, 2015, 12:12:30 PM    
Hi, i have tried to install thedatabase toolbox at scilab on lubuntu 15.04, but it gives
me an error that he coulnd not find the myslclient and its drivers. I serched in the
internet and saw, that the driverslist are a little bit old.

could you please for Scilab 6 renew the Toolbox for ubuntu/lubuntu 15.10.

Thanks Pascal Buehler 
Comment from Arthur Zu -- January 24, 2016, 03:10:25 AM    
Well, it is available in my 64 Bit installation, but does not work. I consider it a major
bug.
Comment from shubhangi mathe -- February 18, 2016, 10:06:53 AM    
I am facing problem in DbConnect,gives error 999 for ODBC.Plz ,Plz guide me!!
Comment from Arthur Zu -- March 18, 2018, 01:09:55 AM    
Hi
Can't install it for Scilab 6. Any updates for Scilab 6 planned?
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
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.