From 92602651dcc380b4b96d13a2102838d631d78241 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 23 Oct 2006 17:46:08 +0000 Subject: [PATCH] Now insert_record() is using $db->GenID() to retrieve sequence numbers for Oracle. Just wondering if the same function should be used by PostgreSQL too. MDL-7183 Merged from MOODLE_17_STABLE --- lib/dmllib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index e9e4a1b65c..c0989d9bdf 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1147,7 +1147,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') { $generator->setPrefix($CFG->prefix); $seqname = $generator->getNameForObject($table, $primarykey, 'seq'); } - if ($nextval = (int)get_field_sql("SELECT $seqname.NEXTVAL from dual")) { + if ($nextval = (int)$db->GenID($seqname)) { $dataobject->{$primarykey} = $nextval; } } -- 2.39.5