Home > database >  PB8.0 can connect two ORACLE database?
PB8.0 can connect two ORACLE database?

Time:09-19

Consult the

PB8.0 can connect two ORACLE database, two database on different servers

A through O84 Oracle8/8 I (8. X. 4 +) are connected (oracle versions for 10 g)
A through the ODBC connection (oracle versions of 8)
I met the problem:
1.
I created a window, inside put two buttons, cb_1, cb_2
Cb_1 button clicked event input inside the first connection,
Cb_2 button clicked event input in the second mode of connection,

If I press cb_1 first then the first can be connected, then according to the second connection cb_2,
If I press cb_2 first then the second can be connected, then click cb_1 first connection,
2.
I create two Windows,
Window_1, use the first link inside way,
Window_2, use the second inside connection way,

If open window_1 first, the first successful connection, open window_2 again, the second connection is successful,
If open window_2 first, the second connection is successful, open the window_1 again, the first connection fails,

Don't know what to do, to solve, I think, is the effect, under normal circumstances according to the first connection mode to connect
Need to do data upload, can be removed from the first connection data stored in the variable, and then connected to the second
Oracle, the data uploaded, upload, can close the second oracle connection, reconnect to
The first on the oracle,

CodePudding user response:

Like this? Code to put up the study?

CodePudding user response:

Create two links of the transaction,

CodePudding user response:

To define a transaction object is ok, don't say two, you can even dozens of hundreds of all, as long as the machine performance with the
Remember to define other affairs, to add a using transactions when executing SQL object;

CodePudding user response:

Upstairs, positive solutions need to define a trans, both connection can't use the sqlca,

CodePudding user response:

The
refer to the original poster u011948837 response:
to ask

PB8.0 can connect two ORACLE database, two database on different servers

A through O84 Oracle8/8 I (8. X. 4 +) are connected (oracle versions for 10 g)
A through the ODBC connection (oracle versions of 8)
I met the problem:
1.
I created a window, inside put two buttons, cb_1, cb_2
Cb_1 button clicked event input inside the first connection,
Cb_2 button clicked event input in the second mode of connection,

If I press cb_1 first then the first can be connected, then according to the second connection cb_2,
If I press cb_2 first then the second can be connected, then click cb_1 first connection,
2.
I create two Windows,
Window_1, use the first link inside way,
Window_2, use the second inside connection way,

If open window_1 first, the first successful connection, open window_2 again, the second connection is successful,
If open window_2 first, the second connection is successful, open the window_1 again, the first connection fails,

Don't know what to do, to solve, I think, is the effect, under normal circumstances according to the first connection mode to connect
Need to do data upload, can be removed from the first connection data stored in the variable, and then connected to the second
Oracle, the data uploaded, upload, can close the second oracle connection, reconnect to
The first on the oracle,


Use the sqlca connect directly to oracle, in addition to build a transaction connection ODBC, the following code

The transaction sqlca_odbc

Sqlca_odbc=create transaction
Sqlca_odbc. DBMS='ODBC'
Sqlca_odbc. Logid=sqlca. Logid
Sqlca_odbc. Logpass='* * * *
Sqlca_odbc. Servername='* * * * *
Sqlca_odbc. Dbparm='
Connect using sqlca_odbc;
If sqlca_odbc. Sqlcode=0 then
//
The else
Gnv_app. Of_message (' connection ODBC database failed, error content: + sqlca_odbc. Sqlerrtext)
The return - 1
End the if

Dw_1. Settransobject (sqcal)//bind oracle connection transaction, and then to retrieve or update can
Dw_2. Settransobject (sqlca_odbc)//bind odbc connection transaction, and then to retrieve or update can

Pay attention the commit, transaction object, after it defaults to the sqlca,

Like to submit an odbc connection transaction, need to use

Commit the using sqlca_obdc;

CodePudding user response:

Agree with the upstairs, how much do you want to connect all no problem
  • Related