open-insight/LSL2/STPROC/DONT_USE_DELETE_ORDER.txt
2024-05-22 14:06:46 -07:00

40 lines
884 B
Plaintext

compile function DONT_USE_DELETE_ORDER()
begin condition
pre:
post:
end condition
declare function msg, fieldcount, next_key
declare subroutine rlist
$insert rlist_equates
$insert msg_equates
$insert logical
open 'ORDER' to OrderTable else
Void = msg( '', 'Unable to open ORDER table...' )
return 0
end
Stmt = 'SELECT ORDER WITH ENTRY_DATE < "1/1/00"'
rlist( Stmt, target_activelist$, '', '', '' )
DEBUG
if @reccount then
Eof = false$
NumKeys = @reccount
Cnt = 0
loop
readnext OId else Eof = true$
until Eof
delete OrderTable, OId else
msg( '', 'Unable to delete ORDER ':OId )
return 0
end
Cnt += 1
Percent = oconv( iconv(Cnt/NumKeys, 'MD2'), 'MD0' ):'%'
Void = send_info( Percent:' Complete DELETING orders...' )
repeat
end
return 0