The Mango SQL Console provides the ability to directly access the system's database for both querying and updating. This facility is provided primarily for troubleshooting or system repair. It is not appropriate for regular use due to the risk of data corruption.
Only valid individual SQL statements may be submitted. Do not end your statements with ';' characters.
To get a list of tables created by your Mango Automation instance, click the Get table list button
Useful SQL Commands
Total number of Data Points:
select count(*) from dataPoints
Total number of Events
select count(*) from events
Useful information
When looking at data in the events table you may want want to sort by the alarm level. You can reference this list to determine the numeric representation of the log levels:
- NONE = 0
- INFORMATION = 1
- URGENT = 3
- LIFE_SAFETY = 4
- DO_NOT_LOG = -2
Quickly Purge Large Table
During database conversion you may need to purge the contents of a large MySQL table such as the pointValues table. These steps will allow you to do this quickly and efficiently.
-
rename the pointValues table to pointValues_old
-
se this SQL command:
CREATE TABLE pointValues SELECT * FROM pointValues_old LIMIT 0
- Drop the pointValues_old table.
Note: this will permanently delete all pointValues data