Hello all. I am in need of some assistance. I have been tasked with writing an interface between our .NET app and another vendors app residing in a UniVerse database running on a LINUX server. I am looking for the fastest, cheapest, easiest ( aren't we all? ) to get data from the UniVerse into a flat file on the LIMUX server. I've read IBM doc till I'm cross-eyed.
Does anyone out there have any experience with this?
There are many ways of doing this - you can proactively get the data via odbc, there is an object interface for .net where you can get data and run stored procedures through. it etc. There are reporting tools that can extract data into whatever format, even terminal emulators that will grab data for you. SOme of these will need licences but you may already have them anyway Most universe licences come with odbc and uniobjects.
Anyway the easiest and quickest would probably be to write a stored procedure (Unibasic) in the database to grab the data and write a csv file that you can then use. Thsi may not be the best going forward tho.
Thanks for the feedback. Would it be possible to get an example of some BASIC code that performs this? I am not that familiar with BASIC, especially UniVerse style.
I am attempting to retrieve information out of a client's database. They have no documentation or expertise with it. They are phasing out their current vendor's software, so they are NOT forthcoming at all with assistance and guidance.
You basically need to open the database file, open a csv file as a sequential file, select the database file and loop through it, in each loop read the record in and then write it away as a csv. This may be as easy as converting attribute marks to commas, if there are subvalues you may want put some other character in. you then write the line to the csv file. It all depends on the data dictionary of the file you want to dump. It kinda sounds that you are talking some complex data here. A dump into CSV is fine for one set of simple data, but if you are talking multiple tables which have values and sub values (nested tables) you would have to produce a csv per table, value set and sub value set which would then get rather complex. Also if you are going to do anything with the data you need to know the data dictionary/schema so you know what to extract. Anyway an example bit of code to dump all records of a simple database file with no multi/sub values is :
OPEN 'FILENAME' TO dbFil ELSE STOP 201,'FILENAME'
OPENSEQ 'C:\FOLDER\FILE.CSV' TO csvFil ELSE STOP 201,'FILENAME'
LOOP WHILE READNEXT dbID DO
READ dbRec FROM dbFil,dbID ELSE dbRec=''
WRITESEQ line APPEND ON csvFil ELSE CRT "error"
or something similar - that was just off the top of my head.