Moodle plugins directory: Ad-hoc database queries

Moodle plugins directory: Ad-hoc database queries

This report plugin allows Administrators to set up arbitrary database queries
to act as ad-hoc reports. Reports can be of two types, either run on demand,
or scheduled to run automatically. Other users with the right capability can
go in and see a list of queries that they have access to. Results can be viewed
on-screen or downloaded as CSV.

This report, created by The Open University, lets Administrators set up arbitrary SQL select queries that anyone with the appropriate permissions can then run. Reports can be set to be runnable on-demand, or automatically run weekly or monthly.

The results are displayed as a fairly plain HTML table, and can also be downloaded as CSV.

The idea is that this lets you quicly set up ad-hoc reports, without having to create a whole new admin report plugin.

I am having trouble with this on a 2.7 in that the following query only returns a few courses from a variety of categories. The same query works well for me on a 2.6. I noticed that in the 2.7 I have an extra box at the bottom of the edit query screen labelled 'Select category for this report' I am trying to generate a report of most active courses across all categories. Thank you for your time.

I LOVE this plugin and use it often. I often use named placeholders so that values can be input when the report is run, but I'm wondering if anyone knows of a way of doing what would basically amount to the following:

1) entering multiple values in the named placeholder (for example, not just course id=1234, but course id=1234,2345,3456
2) using a wildcard (for example, not just a specific course id, but ALL courses -- yet still giving the user the option of entering a specific course)

If anyone has any ideas or solutions, I'd really appreciate it! It would save me a lot of time!

We tried to install this plugin to our Moodle version 2.56. We installed the newest version 2.7 for Moodle 2.4+ (2014061800) but we ended with en error.

Capability "report/customsql:view" was not found! This has to be fixed in code.
line 389 of /lib/accesslib.php: call to debagging()
line 1258 of /lib/adminlib.php: call to has_capability()
line 3408 of /lib/navigationlib.php: call to admin_externalpage->check_access()
...

Hi Tim, I'm not to good on the SQL stuff, and I need to run a simple report to extract info on single users, for course/subject completion, dates and grades.
Can you advise the best code for this please?
Thanks
Bruce

Hi Tim, How's it going? I trying to run this query ti get the outstanding activities for each student. it runs in phpmyadmin, but it won't run in Moodle. In Moodle, the first query (nested select) runs fine, it's when I add the NOT IN select that causes the problem. Any idea? Or another way to do this? Cheers, Mykl

The error I get is Error when executing the query: Error reading from database Incorrect key file for table '/var/mysqltmp/#sql_1f3_0.MYI'; try to repair it...I think I'm blowing the tmp space I think I'll need to increase the size.