Print Thread
How do I commit a select statement in a distributed query
#4611 02/24/03 10:51 AM
Joined: Feb 2003
Posts: 3
Victoria, Australia
M
Member
OP Offline
Member
M
Joined: Feb 2003
Posts: 3
Victoria, Australia
I have a TOracleDataSet that has a SELECT
statement that uses several databases eg:

SELECT project_no
FROM ledger l
UNION
SELECT project_no
FROM ledger@db.melbourne.home.com l
UNION
SELECT project_no
FROM ledger@db.sydney.home.com l

This query's results are used in a Quick Report. However, after the report has been closed, a transaction TX lock that Oracle created is not released. From reading around I believe that it is necessary to commit even SELECT statements due to two-phase commit used for distributed databases.

However, have tried using the OracleSession.Commit directly after opening the query but this has no affect.

Any advice greatly appreciated.

Re: How do I commit a select statement in a distributed query
#4612 02/24/03 10:36 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
A TOracleSession.Commit should do the trick. Note that if the dataset fetches new records (e.g. a refresh), Oracle will start a new transaction due to the database link.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: How do I commit a select statement in a distributed query
#4613 02/25/03 03:26 AM
Joined: Feb 2003
Posts: 3
Victoria, Australia
M
Member
OP Offline
Member
M
Joined: Feb 2003
Posts: 3
Victoria, Australia
Thanks very much. The query had a master,so I put a TOracleSession.Commit in the AfterPrint of the master query's report band and hey presto!


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.030s Queries: 13 (0.007s) Memory: 2.5040 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-20 21:36:08 UTC
Valid HTML 5 and Valid CSS