U2 Ruby: Ruby integration for IBM UniVerse and UniData
Posted by tom February 8th, 2007
This week a colleague and myself have been working hard to create a Ruby extension which allows Ruby to make RPC calls to UniVerse and UniData (the IBM U2 databases). The module has been dubbed U2, the class UniRPC. It implements the intercall interface, and from that the functions: open, close, opensession, quit, readlist, execute, read, write & delete. Within the c-code it translates the @FM separated records (and readlists) into Ruby Arrays (for easy access). It currently does not translate @VM, @SM & @TM to sub-array structures, but maybe one day…
We’ve also created a ActiveRecord-like class to work with U2 files (tables & records) all in all pretty interesting!!

March 8th, 2007 at 04:40 PM
I’m in need of doing something similar for a project on which I am working. Can you point me to some good resources for doing things like this?
As some point in the future, will your work be available as a product?
Thanks, Keith Veleba
March 9th, 2007 at 11:16 PM
Hi Keith,
Well it’s probably not going to be released as a product, though I myself would not have any problems with that, but my employer probably will. I’m still investigating whether I could write an article about this with IBM developerWorks, but that’s also still not sure.
Tom
PS On resources: ONLamp.com article U2 Library: InterCall Developer’s Guide
June 5th, 2007 at 11:53 PM
I’ve tried hooking up to Unidata via Rails without luck. There’s an IBM Unidata Driver for ODBC, and using that connection with the sqlserver adapter, it connects but fails when ActiveRecord tries to run SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘BASE TABLE’;
Error: Qualified table names are not yet supported: INFORMATION_SCHEMA.TABLES.
-Les
September 12th, 2007 at 08:37 PM
Hello, nice post. Bookmark it.