Do you work in a development environment with multiple iSeries that don't always have all of the SQL tools installed? Or have you ever felt like it would be so much easier if you didn't have to log into a display session on another server just to do a quick query? Use these three simple steps to configure and use your local system to run SQL statements on a remote system.
1. Add a remote database directory entry to your system with the ADDRDBDIRE command.
(Click images to enlarge.)
The relational database name is generally the same as the system name of the remote system. The remote location name can be an SNA remote network identifier, a TCP/IP host name, or an IP address, depending on your networking environment. The type will depend on your network. The default values should be acceptable for the rest of the parameters. There's also a WRKRDBDIRE command that can be used to manage remote database connections.
2. Connect to your remote database.
Start an interactive SQL session using STRSQL, type Connect in the SQL statement, and press F4. Select option 1 for a remote connection and specify the database name you created in the previous step. If your user ID and password on the local system also exist on the remote system (with appropriate authority), you don't need to specify a user ID or password on this screen.
At this point, you're free to run interactive SQL statements against the remote system.
3. Don't forget to disconnect.
When you're finished, disconnect from the remote database by using the "disconnect current" statement. You can reconnect to your local database by using the "connect reset" statement or end your interactive SQL session.
Daniel Narkorn has spent the past 27 years in MIS technical and managerial positions. For the past 17 years, he's been an independent Information Systems consultant, specializing in the iSeries/400 platform and concentrating on Client/Server and Internet/intranet technology. He can be reached by email at
LATEST COMMENTS
MC Press Online