× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Nick,

The way I usually do this (I primarily do this from CGI programs which
usually have already open connections) is use SET CONNECTION :database
(this is the syntax for switching to another database you have a
connection to) and check to see if SQLSTT is 08003. If it is, that means
a connection needs to be established and I use CONNECT to :database to
establish the connection. You can only be connected to a single database
at a time but you can switch between which connection you're using
anytime you need to.

Also, if you're using commitment control, COMMIT and ROLLBACK only apply
to the active connection. Also, it's a good idea to do a ROLLBACK (this
can be skipped if not using commitment control), a CONNECT RESET, and a
SET CONNECTION to your local database at initialization time. These
statements will ensure you have a good connection to both the local and
remote databases and that you know which database the program is
pointing to.

Finally, make sure you have fairly current database group PTF's on both
systems. There have been some very nasty problems with DRDA (like DRDA
stomping on programs) that you don't want to run into.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
nickmart@xxxxxxxxxxxxxxx
Sent: Thursday, November 02, 2006 2:55 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: SQL Connect to question

I am working on an application where I would like to be able to use the
SQL CONNECT TO (database name) if different than the default. The
database
is secured and assigned to its own storage pool.

My question is this. If the user job is already pointing at this
database,
do I need to use CONNECT TO :database USER:userprf USING :userpassword
or
just CONNECT TO :database?

Thanks in advance.

Nick W. Mart


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.