Clearing OpenInsight SYSLISTS Table

The SYSLISTS table in OpenInsight can become cluttered with old records and much like a TEMP directory it can and should be cleared out. When it comes time to clear the table the clear_table command won't work because SYSLISTS is a protected system table. Instead the easiest thing is to simply select and delete all the records. 

Here is a sample routine to do the task.

Function CS_CLEAR_SYSLISTS(params)
$Insert Logical

CounterSuccess = 0 ; CounterFail = 0 ; done = FALSE$
TableName = 'SYSLISTS'
Open TableName to Table Else
	Call Msg("Couldn't open table " : TableName)
	Return
End

Select Table

loop
	readnext @ID Else Done = TRUE$
until done
	
	delete Table, @ID Then 
		CounterSuccess += 1
	End Else
		CounterFail += 1
	End	

repeat

Call Msg("Deleted " : CounterSuccess : " recs from " : TableName : "|" : CounterFail : " could not be deleted")

Return

Simply compile and run the routine to purge all of the SYSLISTS records. Not all of the SYSLISTS records are old, this is an active table used for ongoing tasks by the system so it should only be cleared when the system is not in use and after checking there are no saved lists that are still needed.

Share this post

Comments (2)

  • anon

    Alternatively, this System Monitor command seems to bypass the System Table check:

    RUN DELETE_ROW 'SYSLISTS', '*'

    Cheers, M@

    Feb 24, 2016
  • Jared Bratu's picture

    Thanks for sharing the tip! This is especially useful since it doesn't require additional routines.

    Jul 23, 2016

Leave a comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

About Us

Congruity Service is a technology solutions company bringing the best technology solutions to OpenInsight projects, Drupal sites, servers, networks, and your technology needs.