moodle-block_configurablereports icon indicating copy to clipboard operation
moodle-block_configurablereports copied to clipboard

"no explicit prefix" when using prefix_table_name in oracle sql report.

Open Novocastrian opened this issue 4 years ago • 0 comments

I'm trying to run the following SQL report via the plugin on Moodle 3.7 on an oracle 12.1.0.2.0 database, but it complains "no explicit prefix", even though I'm using 'prefix_' as required by the plugin.

select
    concat('<a target="_new" href="%%wwwroot%%/course/view.php?id=',c.id,'">',trim(c.fullname),'</a>') as "course name",
from prefix_course c
	join prefix_logstore_standard_log lsl on lsl.courseid = c.id
	    and lsl.courseid = c.id
	    and c.visible = 1
    	    and lsl.timecreated between add_months(trunc(sysdate, 'month'), - 12) and shipdate < trunc(sysdate, 'month') 
	    and c.id != 1
group by c.id, c.fullname
order by "course name" asc


image Any ideas? I'm no oracle DB expert (a rookie MySQL writer at best), so I have literally no idea what is going on here. I've run this report on MySQL and PostGre Moodle databases (using the correct fucnctions on the lsl.timecreated where clause, obviously) and it works fine.

Novocastrian avatar Mar 27 '20 01:03 Novocastrian