Using SQLRPG on a DDM File

pts.
Tags:
IBM DB2
RPG
RPGLE
Hi, I need to access a DDM file via SQLRPG -since SQL does not directly support DDM -can it be done by first using OVRDBF on the DDM file to override it to a local file and then use SQLRPG ? Help would be much appreciated for a project I am currently working on. Thank you! Ruwan

Answer Wiki

Thanks. We'll let you know when a new response is added.

Ruwan…
The only way I know to do this is to issue an SQL “CONNECT” statement to attach to the remote database. This can be done within an SQLRPG pgm, but you will need to compile the program against the remote database (see the compile prompts). You may want to do this in a separate module from your main program… You will also need to define the remote database using the WRKRDBDIRE command.

===================================================

Nobody ever “needs” to access a DDM file via SQLRPG. The problem is stated incorrectly. A more likely situation is that the system has a DDM file that accesses a remote file and the OP needs to use SQL in RPG to access the same remote file. Why “need” to use the intermediate DDM file when you can connect directly… especially when the intermediate form of access isn’t supported?

Just connect to the remote database and access the file.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following