5 pts.
0
Q:
Using SQL Connect Statement in SQLRPGLE
I need to use the SQL CONNECT statement within a SQLRPGLE program to connect from one AS400 system to another. I need to get data from one file to another. Does anyone know how to do this? Can it be done within a program. I have no trouble when I do it on an SQL command line... I use CONNECT to sys02name user usern using mypassword. Then I use the select statement to get the records I need. If I can do this in an rpg or clp program, that would be helpful. I can't use FTP for this.
ASKED: Jun 24 2009  9:00 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1215 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Use the WRKRDBDIRE (Work with Relational Database Directory Entries) command to define the data source.

/EXEC SQL

+ CONNECT TO :remotedb USER :userprf USING :passwrd

+ SET CONNECTION remotedb

*** your select statements should work now

/END-EX
Last Answered: Jun 30 2009  6:03 PM GMT by Satsho   1215 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0