Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iseries access to remote and local table

Status
Not open for further replies.

rarogersonkf

Programmer
Aug 23, 2005
23
0
0
CA
Is this possible?

CONNECT TO <remotemachine> USER <user> USING <password>;
INSERT INTO <localmachine>.localtable
SELECT *
FROM <remotemachine>.remotetable;

If I issue
SELECT *
FROM <remotemachine>.remotetable;
then all rows are corrently returned.
My problem is specifying the local table.

Can I access a remote table and a local table in one statement?

Thanks in advance,

Rob
 
No, unfortunately, you can't do that. But if both machines are AS/400's, you should be able to create a DDM file that points to the remote table.

Me transmitte sursum, Caledoni!

 
Maybe that's why it took so long to get a response. You can't use a DDM in SQL. RPG, no problem, but the EDI source has inline SQL.
So, my question is, how do I go about doing it. It doesn't seem to be that far out there. Especially when you think that IBM is pushing LPAR so much.

Thanks again.

Rob
 
You can use FTS:


Compile the FTS command using QY2FTML as the CPP (the command to compile is found at the top of the command source in this link). You can use this command to get a copy of the remote file before you run your SQL. Not the prettiest solution, but it does work.


Me transmitte sursum, Caledoni!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top