Using Oracle Views in Enrolment Plugin

Using Oracle Views in Enrolment Plugin

by Eleri Valiant -
Number of replies: 6

Hi folks.

As part of our implementation of Moodle, I've been looking at getting the authentication and enrolment plugins set up so that all our students and staff can log in using their network credentials and be automatically enrolled in the courses our MIS system says they're on. Getting authentication working with LDAP was fairly straightforward, but I'm having some diffculty with the enrolment plugin side of it.

So far I have managed to get Moodle talking to Oracle (the database behind our student records system) using the "oci8po" setting as recommended on this forum, but I can only get it to do the enrolments when I give it a table as the db_table parameter - it won't return anything when I give it a view. I find this a bit odd as the majority of drivers that I've used before to talk to Oracle from other databases seem to treat tables and views more or less the same. I would really like to use a view if possible so that the enrolment data is dynamic rather than having to script periodical updates to a static table.

Can anyone suggest why it might be that a table is acceptable as a source to Moodle when a view is not? Has anyone else successfully used an Oracle view as a source for an enrolment plugin before?

Thanks!

Average of ratings: -
In reply to Eleri Valiant

Re: Using Oracle Views in Enrolment Plugin

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
We've been using Oracle views for the last year without any special configuration. Beware there were a couple of bugs in earlier versions (somewhere in the first releases of 1.7.x) but they should be fixed by now in the lastest versions of 1.7.x and 1.8.x

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Using Oracle Views in Enrolment Plugin

by Eleri Valiant -

Thanks for confirming that it was possible! I have now managed to get the plugin working with a view without any changes to Moodle - not sure of the exact root cause of my original issue but I suspect permission sets on the Oracle end.

In reply to Eleri Valiant

Re: Using Oracle Views in Enrolment Plugin

by Karl Kennedy -

Hi Eleri,

Do you have any idea what the permission sets were? I'm having the same problems...

Thanks,

Karl

In reply to Eleri Valiant

Re: Using Oracle Views in Enrolment Plugin

by Karl Kennedy -
Does ANYONE know??????????? surprise
In reply to Karl Kennedy

Re: Using Oracle Views in Enrolment Plugin

by Martín Langhoff -
Just make sure that you can connect to Oracle (with sqlplus or similar) with the same credentials you use for Moodle, and that you can run queries on the tables or views that you expect moodle to read.

Once it's all ok with sqlplus, try and hook things up with Moodle smile
In reply to Martín Langhoff

Re: Using Oracle Views in Enrolment Plugin

by Karl Kennedy -
Hi Martin! smile

Thank goodness someone has replied!

I am able to connect with a separate script from the same box Moodle is on but when all the settings etc are set up for the Enrolment, it just doesn't work! When the student logs in, they aren't enrolled in the course. I thought perhaps it might be to do with the views or permissions? I'm using the normal Moodle set up with Linux, Apache, MySql and Php then an external Oracle database with two fields (username & coursecode). The only setting I'm not sure on actually is which db_type it should be set to, I've tried a few and they all don't work...

Many Thanks,

K