diff options
-rw-r--r-- | lib/db.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/db.php b/lib/db.php index cf352fe9fb0..8b2f36aac62 100644 --- a/lib/db.php +++ b/lib/db.php @@ -322,12 +322,20 @@ class OC_DB { $row = $result->fetchRow(); self::raiseExceptionOnError($row, 'fetching row for insertid failed'); return $row['id']; - } else if( $type === 'mssql' || $type === 'oci') { + } else if( $type === 'mssql') { if($table !== null) { $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); $table = str_replace( '*PREFIX*', $prefix, $table ); } - self::$connection->lastInsertId($table); + return self::$connection->lastInsertId($table); + } + if( $type === 'oci' ) { + if($table !== null) { + $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); + $suffix = '_SEQ'; + $table = '"'.str_replace( '*PREFIX*', $prefix, $table ).$suffix.'"'; + } + return self::$connection->lastInsertId($table); } else { if($table !== null) { $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); |