Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The information on this page refers to License Statistics v6.13 and newer, which introduced ability to save the query after execution. If you are using a version previous to v6.13, see documentation for previous versions.

You can query the database to get a custom usage report for additional usage data using the web-based UI or at a command line, as described below. The table reference to the MySQL database is stored in mysql/database_structure.sql.

Generating

...

SQL reports using the

...

UI

To run a SQL query on the License Statistics database using the web-based UI:

  1. Log into License Statistics as an administrator.
    Click Administration at the top of the License Statistics web page.

  2. From the Administration page, click the SQL Console tabSelect the SQL Console page under the Administration section in the left navigation pane

  3. Enter your custom SQL query in the edit "SQL Query" text box and click Submit Execute to generate the report.

    The Custom SQL Report appears in the area below the "Custom SQL Query" edit box. Query results will be returned in a grid only if you enter a query that returns data; e.g., SELECT or SHOW.

  4. If desired, click Save to save the query. A dialog will allow you to name the query. You can also edit the query if needed by changing the entry in the SQL Query edit box.

    Image Added

  5. After saving the query, it will be available from the Saved Queries grid.

    Image Added

Exporting query data

You can export the data returned from the query by clicking on one of the Download options under Save As at the top bottom right of the Custom SQL ReportQuery Results grid. For example, you may want to view the report in Excel or PDF so you can include it in a report or presentation. See Downloading License Statistics data for more information about obtaining data in various formats.

Warning

...

Use caution when running queries that use UPDATE or DELETE keywords, because using these keywords can cause data loss or corruption.

Saving a query

You can save SQL queries under the Saved Reports area so that you can easily run the query in the future.

To save a query for future use:

  1. Click Add New under the Saved Reports area.
  2. Enter a name for your report in the Report Name field.
  3. Enter the SQL query in the SQL query field.
  4. Click Save to save the query.
  5. To run the saved query, click on it in the Saved Reports list. The query appears in the Custom SQL Query area.
  6. Click Submit to submit the query.


Info

The default query limit is 1000 rows. It can be overwritten using LIMIT keyword in the SQL statement.

...

Running a SQL query from a command line

To run a SQL query from a command line:

...

If needed, it's possible to execute custom SQL statements from the command line. To do so use the procedure described on the Running a custom SQL script page.