Using ODBC in Matlab without database toolbox - matlab

I want to connect from Matlab to Algo Financial Modeller results that are accessible through ODBC. However, I cannot find anyway to do it without database toolbox that I do not have.
I found this discussion:
How to connect to Microsoft SQL Server 2008 (MSSQL) from Matlab?
But unfortunately there isn't presented any way that uses ODBC.
I would be grateful for any help in that matter.
Thanks in advance!
Artur

Yes, you can do without the database toolbox and use ODBC via ADO.
Example of something that works for me:
conn = actxserver('ADODB.Connection')
conn.Open('driver={MariaDB ODBC 3.0 Driver}; server=myserver; port=myport; dns=mydb; uid=user; pwd=password')
conn.Execute('use mydb')
r = conn.Execute('select * from my_table')
r.GetRows()
Some remarks:
Obviously, replace MariaDB ODBC 3.0 Driver with your own ODBC driver
Despite what some documentations say, server=myserver,myport does not work for me, port=myport does.
For some reason, despite having dns=mydb in the connection string, I still have to use mydb.

Related

Configuration parameters for PostgreSQL ODBC driver connection string

I am currently extracting data from PostgreSQL using its own ODBC driver.
The basic parameter described on Connection Strings work so far, but I was not able to find which other parameters are supported.
The documentation of the Devart ODBC Driver also supports the field Schema, which does not seem to work with the one of the PostgreSQL project.
Last but not least, there is a list in the documentation of the ODBC driver listing connection keywords, but these do not match the ones in Connection Strings either.
Is there any resource or standard describing the Connection String parameters I missed?
You should trust the documentation of the product rather than an unrelated site.
If you want to set the search_path with a connection option, you can use the Pqopt parameter like this
pqopt={search_path=myschema,public}
Disclaimer: I didn't test it.

Connecting Neo4j and Matlab

Would anyone happen to know, if there is any good way of operating Neo4j (or any other graph database) from Matlab?
R environment seems to have RNeo4j and I'm surprised that I didn't find any equivalent.
Thanks!
Just few ideas:
You can use the Cypher REST interface of Neo4J and this Matlab JSON plugin (found by this SO answer)
Or you can use the the Matlab JDBC connection (like SQLite use OTHER as vendor string) and the Neo4J JDBC driver
Matlba offers also an ODBC Native connection system but unfortunately Neo4J doesn't - even if there are some experiments going on...

X architecture db2 to connect 2 databases

I am just a beginner and I was trying to learn how to use the x Architecture to connect two db2 databases. I know some stuff about XA like, it acts like an API between different databases. I was wondering if someone has some resource with all the xa db2 commands and I could try them out. I think I cannot use command line for xa, I need to write an SQL application. Please, correct me where I am wrong. Thank you. Every answer is appreciated.
Why are you not using db2 federation?

Progress ABL procedure to SQL Insert

We have a software solution that involves syncing some data between a Progress database and SQL server. Unfortunately, we do not have any Progress gurus in house, so I'm working kinda blind here and would welcome any advice that is on offer.
For the workflow that is already in place, what would work very well for us is the ability to do an external call to insert a row into an SQL database from an within ABL procedure's 'for each' loop.
Is anyone able to direct me to any code snippets or articles that might help me achieve this?
Many thanks,
In case your SQL database is MS SQL Server, you might want to have a look at OpenEdge DataServer for Microsoft SQL Server (web.progress.com/en/openedge/dataserver-microsoft.html, documentation.progress.com/output/OpenEdge102b/pdfs/dmsql/dmsql.pdf).
The DataServer provides you with ABL access to a non-Progress database so you can use standard Progress statements, e.g. CREATE to add new records or FOR EACH to retrieve query results.
OpenEdge DataServers are also available for Oracle (using Oracle Call Interface), DB2 and Sybase (using ODBC). The DataServer for MS SQL Server uses ODBC behind the scenes as well. web.progress.com/docs/datasheets/openedge/openedge_dataservers.pdf
You dont need the dataserver, connection with ADODB works fine in ABL, you can even call stored-procedures with the command object, the user you connect with will have to be granted EXEC rigths on the SQL-Server to do that.
I'm not a Progress guru, but I did do some work in it for awhile. AFAIK there is no way to have ABL code connect to a non-Progress database (part of that whole vendor lock-in strategy Progress Corp. leverages).
Your best bet is probably to have the ABL code serialize the records to XML, and use something like ActiveMQ (or even a plain socket or named pipe/FIFO depending on your setup) to send them to a program written in a more capable language to do the SQL insert.

PostgreSQL data comparsion tool

I am looking for a tool/command which can compare data between two PostgreSQL databases. The reason to do this is to have some external verification that the SQL script responsible for data migration from one PostgreSQL database to the other have been written correctly.
Any pointers would be appreciated
regards
Sameer
EMS makes a tool which can do this.
http://sqlmanager.net/en/products/postgresql/dbcomparer
The PostgreSQL site has a nice Software catalogue. Peruse the Administration/development tools category.