Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Question Unanswered: Extract data from UniVerse??

    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?

  2. #2
    Join Date
    Oct 2004
    Posts
    24
    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.

  3. #3
    Join Date
    Oct 2004
    Posts
    2

    Question Examples please

    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.

    I appreciate any help at all.

    Thanks.

  4. #4
    Join Date
    Oct 2004
    Posts
    24
    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'

    SELECT dbFil
    LOOP WHILE READNEXT dbID DO
    READ dbRec FROM dbFil,dbID ELSE dbRec=''
    line=CHANGE(dbRec,@AM,",")
    WRITESEQ line APPEND ON csvFil ELSE CRT "error"
    REPEAT


    or something similar - that was just off the top of my head.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •