Re: ESQL problems in migration from ON-LINE to SE
Posted in 1996
In article <51s8lr$tot@nw101.infi.net>,
davzhong@richmond.infi.net (david zhong) wrote:
>Hi, Informix SQL Gurus:
>
>I have the following questions:
>
>Our application is migrating from Informix On-Line to Informix SE.
>In our application, I need to create a joined table from tables in
>DIFFERENT databases, using ESQL/C. This could be easily done with
>ON_LINE engine which allowes opening multiple databases at the same time.
>Howere, Informix SE can open only one databases at a time. Is there a way
>to fix the problem. Any hint will be appreciated.
>
>David.
>
Here's one solution -. What follows in part of a 4gl program
FUNCTION get_info_from_2dbs()
# First, select the first Database
DATABASE db_one
# Unload the table
UNLOAD TO junk.dat
SELECT * FROM db_one_table..Add where clause if possible
# Select the second database
DATABASE db_two
# Load the data into a table of identical structure (or create temp table..)
LOAD FROM junk.dat
INSERT INTO db_two_table
# Now, query away.
...
END FUNCTION
Hope this helps,
Rudy