"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 11/16/2017 03:58:57
PM:
I have a program (that I do not have source for) that is connecting to a
remote database to retrieve some data from it. When control is returned
to
my RPGLE program and I try to insert into the database on the current
machine, it fails because (assuming) it is still connected to the remote
database. What is the correct way to disconnect from the remote
database
(remote database / machine can vary so I don't know the specific name of
it)
and reconnect to my local database so that I can insert into the local
database?

I have found that the following works for me when I'm completely
done with the remote database.

exec sql commit; // complete the commitment process
exec sql release rmtdb; // release the database
exec sql disconnect rmtdb; // release the connection
exec sql connect reset; // reset to local database

On the flip side, you can switch back and forth between remote and
local databases -- but you have to know the name of the local database.

exec sql set connection dbname;

Sincerely,

Dave Clark

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].