Re: Multiple DB access
Posted in 1997
Claude E. Desrochers wrote:
>
> I am looking for a way, if at all possible, using a single 4gl program,
> to read a table from one Informix database and write to another Informix
> table sitting in a different db.
Sure:
database local_dbs
declare in_curs cursor for "select * from source"
foreach in_curs into in_struct.*
insert into other_dbs@other_server:other_table
values (in_struct.first_col, in_struct.next_col)
end foreach
You can always use the full ANSI syntax to specify a table or anypart of
the syntax that is relevent, ie:
database@server:"owner".table.column
BTW if you have ESQL-C 7.13 or higher I have a utility, dbcopy.ec, that
uses multiple connections to copy data between tables in different
databases/servers. This method turns out to be faster than accessing
one of the tables as a remote database. Email me if you want the code.
Art S. Kagel