added LSL2 stored procedures

This commit is contained in:
Infineon\StieberD
2024-03-25 14:46:21 -07:00
parent 09f1a66046
commit c667dd56eb
1655 changed files with 527967 additions and 0 deletions

View File

@ -0,0 +1,50 @@
compile function update_index_rep( TableName, ColumnName)
$insert logical
declare subroutine index.flush
declare function msg
Continue = true$
if TableName <> '' then
* see if there are any transactions waiting....
TransWaiting = xlate('!':TableName, '0', '', 'X')
if (len(TransWaiting)) and ((len(TransWaiting) > 2) or (TransWaiting<1> <> 0)) else
Continue = false$
end
end else
TableName = ''
ColumnName = ''
end
if Continue then
flush
garbagecollect
* place lock on imaginary file to coordinate that only one station
* at a time does the INDEX.FLUSH
open 'SYSLISTS' to SysListsTable else
Void = msg( '', 'Unable to open SYSLISTS...' )
return 0
end
LockID = 'INDEX.FLUSH*':TableName
MsgUp = false$
loop
Locked = true$
lock SysListsTable, LockID else Locked = false$
until Locked
if status() then
* locked by this station - shouldn't happen, but if it is, proceed
Locked = true$
end
repeat
* have the lock, now do the update
index.flush( TableName, ColumnName)
flush
garbagecollect
* now, release the lock
unlock SysListsTable, LockID else
Void = msg( '', 'Unable to unlock syslists ':LockId )
return 0
end
end
return