Polling Databases on other machines
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration
We are currently looking at a project which will involve one central site with a large Dynamic Server database and several smaller sites with their own databases. The purpose is to enable the smaller sites to continue working if the main central site is ever down. What we would like to be able to do is to poll each of the smaller sites several times a day and update the main central site with the transactions that have occurred on the smaller sites. First of all, is it not possible to set up each of the smaller sites in the $INFORMIXDIR/etc/sqlhosts file such that by just changing the value of INFORMIXSERVER it will access the proper database? Is it possible for the smaller sites to have just the standard engine (SE)? The polling program will be written in Informix-4GL 7.31. Is it possible within the 4GL to select the database desired? Is it possible within the same 4GL program to read from one database and update another database on another machine? Thanks in advance for any input! Candy -- Candy McCall ONLINE Computing, Inc. (candym@olcinc.com)
Candy McCall wrote: > We are currently looking at a project which will > involve one central site with a large Dynamic Server > database and several smaller sites with their own > databases. The purpose is to enable the smaller > sites to continue working if the main central site is > ever down. > What we would like to be able to do is to poll each of > the smaller sites several times a day and update the > main central site with the transactions that have occurred > on the smaller sites. > First of all, is it not possible to set up each of > the smaller sites in the $INFORMIXDIR/etc/sqlhosts Yes. > file such that by just changing the value of INFORMIXSERVER > it will access the proper database? You don't even have to set INFORMIXSERVER -- in fact, I wouldn't go trying to change the environment. Simply connect to 'database@remote' for each of the remote servers you need to connect to. > Is it possible for the smaller sites to have just the > standard engine (SE)? Using the CONNECT statement, you can connect to both OnLine and SE database at the same time. What you can't do is operations which join tables from OnLine with tables from SE in the same SQL statement. If you are using v5.1x SE, then you will need I-Net too; if you are using 7.x SE, then sqlexecd (the key component of I-Net) is bundled with the core product. > The polling program will be written in Informix-4GL > 7.31. Probably 7.30, but ... >Is it possible within the 4GL to select the database > desired? I4GL 7.30 supports the CONNECT statement directly. So the answer is Yes. >Is it possible within the same 4GL program to > read from one database and update another database > on another machine? Yes; you will need to switch connections between the two operations, in general, and save the data in program variables. If the two systems are both OnLine systems and have the same logging mode, you can do the update directly without using intermediate program variables. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"