accessing another database on another machine
Posted in 1999
Garnadi asked how to access a table in a database on another machine, with Informix 7.23 on HP 10.20 on both servers and I4GL 6.0. Art S. Kagel said both servers must be listed in each other's sqlhosts files, then use database@server:table naming in SQL. Tom Grenier asked about /etc/services; Art confirmed that and /etc/hosts entries are also needed.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I want to access a table on another database from another machine. What should I have ? We are running Informix 7.23 on both server running HP 10.20 both. As front end, we use I4GL 6.0. TIA, --garnadi
All you need to do is make sure that both servers are listed in each other's
sqlhosts files. Having done that you can use the appropriate parts of the
full ANSI SQL object naming to access the remote table:
"database owner".database@server:"table owner".table.column
The owners are only needed in a Mode ANSI database otherwise you could, for
example, join to a remote table thus:
SELECT *
FROM customers c,
transactions@other_server.orders o,
transactions@other_server.detail d
WHERE c.cust_id = o.cust_id
AND o.order_id = d.order_id;
Art S. Kagel
Garnadi wrote:
>
> I want to access a table on another database from another machine.
> What should I have ?
>
> We are running Informix 7.23 on both server running HP 10.20 both.
> As front end, we use I4GL 6.0.
>
> TIA,
>
> --garnadi
Art,
Don't you also need an entry in the /etc/services file?
Tom
"Art S. Kagel" wrote:
> All you need to do is make sure that both servers are listed in each other's
> sqlhosts files. Having done that you can use the appropriate parts of the
> full ANSI SQL object naming to access the remote table:
>
> "database owner".database@server:"table owner".table.column
>
> The owners are only needed in a Mode ANSI database otherwise you could, for
> example, join to a remote table thus:
>
> SELECT *
> FROM customers c,
> transactions@other_server.orders o,
> transactions@other_server.detail d
> WHERE c.cust_id = o.cust_id
> AND o.order_id = d.order_id;>
> Art S. Kagel
>
> Garnadi wrote:
> >
> > I want to access a table on another database from another machine.
> > What should I have ?
> >
> > We are running Informix 7.23 on both server running HP 10.20 both.
> > As front end, we use I4GL 6.0.
> >
> > TIA,
> >
> > --garnadi
Yes and /etc/hosts as well. I got side tracked and when I got back to
this one I just sent it out. Sorry folk.
Tom Grenier wrote:
>
> Art,
> Don't you also need an entry in the /etc/services file?
> Tom
>
> "Art S. Kagel" wrote:
>
> > All you need to do is make sure that both servers are listed in each other's
> > sqlhosts files. Having done that you can use the appropriate parts of the
> > full ANSI SQL object naming to access the remote table:
> >
> > "database owner".database@server:"table owner".table.column
> >
> > The owners are only needed in a Mode ANSI database otherwise you could, for
> > example, join to a remote table thus:
> >
> > SELECT *
> > FROM customers c,
> > transactions@other_server.orders o,
> > transactions@other_server.detail d
> > WHERE c.cust_id = o.cust_id
> > AND o.order_id = d.order_id;> >
> > Art S. Kagel
> >
> > Garnadi wrote:
> > >
> > > I want to access a table on another database from another machine.
> > > What should I have ?
> > >
> > > We are running Informix 7.23 on both server running HP 10.20 both.
> > > As front end, we use I4GL 6.0.
> > >
> > > TIA,
> > >
> > > --garnadi