Reported By: Sanford Aranoff Reported On: 7/17/2004 For: Version 4.08 Build 1
# 1785SQL CREATE INDEX IF NOT EXISTS Statement Still Attempts to Open Table Exclusively If the index exists, the query still demands exclusive.
create index IF NOT EXISTS Accx on StockTraded
(StockName,Account_ID, StockTraded_ID desc)
Workaround:
test:= false;
with DBISAMStockTraded.IndexDefs do
begin
Update;
for i := 0 to pred(Count) do
if Items[i].Name = 'Accx' then
begin
test:= true;
break
end
end;
if not test then
begin
line3:= 'create index IF NOT EXISTS Accx on StockTraded
(StockName,Account_ID, StockTraded_ID desc)';
DBISAMExecQuery.exec_query(line3)
end;
ResolutionFixed Problem on 7/18/2004 in version 4.09 build 1