Connecting to a remote database using SQL
How can I make a connection to a remote database using SQL 400 specifying the database name and the machine where it is?
You can use the SQL CONNECT statement to access any remote database that supports the Open Group DRDA standard.
You need to use the ADDRDBDIRE CL to add an entry and the TCP/IP address of the Remote Database server and assign it a name that will be used on the SQL Connect statement.
The application code would look something like the following: CONNECT TO remotedb1 user using 'passwd'
SELECT col1, col2 FROM remotetablename ORDER BY col1
You can look at the Distributed Database Programming guide in the iSeries InfoCenter for more details on remote database access.
==================================
MORE INFORMATION ON THIS TOPIC
==================================
Check out this Search400.com Featured Topic: Database issues resolved
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: Tips, tutorials and more.