If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Extract data from UniVerse??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-25-04, 16:22
Gman63 Gman63 is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
Question 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?
Reply With Quote
  #2 (permalink)  
Old 10-27-04, 05:37
Sym Sym is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 10-27-04, 10:51
Gman63 Gman63 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-29-04, 06:56
Sym Sym is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On