added LSL2 stored procedures
This commit is contained in:
64
LSL2/STPROC/MODS_LOAD_CONTROL.txt
Normal file
64
LSL2/STPROC/MODS_LOAD_CONTROL.txt
Normal file
@ -0,0 +1,64 @@
|
||||
function mods_load_control()
|
||||
|
||||
$insert logical
|
||||
$insert rlist_equates
|
||||
$insert msg_equates
|
||||
declare function utility, msg, set_property, get_property
|
||||
declare subroutine record_lock
|
||||
|
||||
Stmt = 'SELECT MODS BY PRIORITY BY APP BY TABLE BY ROW BY UPDATE_TYPE BY MOD_DATE BY MOD_TIME' ;* WE HAVE REMOVED ALL DUPLICATES
|
||||
;* SO NOW ALL WE HAVE TO DO IS APPLY IN THE
|
||||
;* ORDER THAT THEY WERE PERFORMED
|
||||
|
||||
Stat = utility( 'CURSOR', 'H' )
|
||||
|
||||
rlist( Stmt, target_activelist$, '', '', '' )
|
||||
|
||||
Stat = utility( 'CURSOR', 'A' )
|
||||
|
||||
UpdatedRows = 0
|
||||
if @reccount then
|
||||
Array = ''
|
||||
Stat = utility( 'CURSOR', 'H' )
|
||||
open 'MODS' to ModsTable else
|
||||
Void = msg( '', 'Unable to open MODS...' )
|
||||
return 0
|
||||
end
|
||||
Eof = false$
|
||||
loop
|
||||
readnext Id else Eof = true$
|
||||
until eof
|
||||
RowToUse = xlate( 'MODS', Id, '', 'X' )
|
||||
Priority = xlate( 'MODS', Id, 'PRIORITY', 'X' )
|
||||
App = field( Id, '`', 1 )
|
||||
Table = field( Id, '`', 2 )
|
||||
Row = field( Id, '`', 3 )
|
||||
Date = oconv( field( Id, '`', 4 ), 'D2/' )
|
||||
Time = oconv( field( Id, '`', 5 ), 'MTH' )
|
||||
UpdateType = field( Id, '`', 6 )
|
||||
|
||||
Array<1,-1> = App
|
||||
Array<2,-1> = Priority
|
||||
Array<3,-1> = Table
|
||||
Array<4,-1> = Row
|
||||
Array<5,-1> = Date
|
||||
Array<6,-1> = Time
|
||||
Array<7,-1> = UpdateType
|
||||
|
||||
if len( Array ) > 64000 then
|
||||
Void = set_property( @window:'.MOD_ROWS', 'ARRAY', CurArray )
|
||||
Stat = utility( 'CURSOR', 'A' )
|
||||
MsgInfo = ''
|
||||
MsgInfo<mtext$> = 'Too many Keys truncating...'
|
||||
MsgInfo<micon$> = '!'
|
||||
Void = msg( '', MsgInfo )
|
||||
Void = set_property( @window:'.MOD_ROWS', 'ARRAY', Array )
|
||||
return 0
|
||||
end
|
||||
repeat
|
||||
Void = set_property( @window:'.MOD_ROWS', 'ARRAY', Array )
|
||||
Stat = utility( 'CURSOR', 'A' )
|
||||
end
|
||||
return 0
|
||||
|
||||
|
Reference in New Issue
Block a user