Re: Acess to "OTHER" Databases from Informix-4GL
Posted in 1993
Robert Tudor (rjtqiaa@werple.apana.org.au) wrote: : I have a requirment to access other database types i.e. Oracle, Ingres, : Progress and Sybase etc. from an existing base of Informix 4-GL programs. I had the same problem some time ago, and queried this newsgroup about it. I wanted to access Informix and Oracle databases simultaneously. Sorry that I took so long to post the promised summary of results; I was away from work for some time. I got several responses suggesting the use of a transaction monitor that handles database access transparently to the frontend program. This is probably the most advanced solution, but not feasible for our situation for several reasons (finances being one of them). I had originally intended to write a C program that incorporated both Informix's ESQL/C and Oracle's Pro*C. Several people suggested that this should be possible, although nobody could tell me for sure whether the respective libraries would not conflict. I was determined to try out, until I installed Pro*C on my machine and found out how complicated Oracle's makefiles are. I am sure the problem could have been solved, but I just didn't have the time to fiddle around. I came up with a solution that may not be too elegant, but works for me. In our application, I have to read data from an Oracle database on a remote Mac server and process these data into a local Online database (inserts, updates and deletes). The Mac data were on a remote Informix host before, but then the remote system was switched due to the infinite wisdom of our hospital computing center :-( Since access to the Oracle data is read-only, I wrote a program that does the necessary selects and writes the resulting rows to stdout, line by line. From the ESQL/C-Program that handles the Informix side, I just do a popen("Oracle_Program","r") and read the results from the pipe. I found this approach a lot easier to implement. Since I was a novice to Oracle, having two separate programs made them much easier to debug and maintain. I don't think this solution could be implemented directly in I4GL, but a C function could be called from I4GL to handle it. Write access to the foreign database should be possible, too, it would require opening a writable pipe. Not too elegant if you have to switch back and forth between databases a lot, however. Then the transaction monitor is probably your best bet. Regards, Richard -- +----------------------------+-------------------------------------------+ | Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3421 | | Klinikum Grosshadern | FAX : +49-89-7095-8886 | | 81366 Munich, Germany | | +----------------------------+-------------------------------------------+