trick for setting isolation dirty read in an Ace report
Posted in 1994
Topics: Stored Procedures & SPL, Transactions, Locking & Isolation
This is a friendly posting describing a 'trick' for solving the problem of
getting no output from an Ace report because some of the rows were locked.
Hypothetical Situation:
Suppose there exists a customer table (in database 'sales') with the following
fields; name, address and credit_limit. You would like a listing of the name
and address of all customers. You write the following Ace report ....
DATABASE sales END
SELECT name,address FROM customer
END
FORMAT
EVERY ROW
END
However, when it runs it returns no data because somebody is changing the
credit_limit for one of the customers.
One solution is as follows (two step solution):
Step 1 of 2
Use DB-Access to execute the following SQL code ...
CREATE PROCEDURE set_isol_dirty() RETURNING INTEGER;
SET ISOLATION TO DIRTY READ; RETURN 1;
END PROCEDURE;
Step 2 of 2
Change you Ace report as below.
DATABASE sales END
SELECT set_isol_dirty() a FROM systables
WHERE tabid = 1
INTO TEMP dummy_temp_table;
SELECT name, address FROM customer
END
FORMAT
EVERY ROW
END
Now the lock record can be read and your report has all the rows instead of
none.
Hope it helps someone,
Mike.