/** @var int The number of rows affected as an integer */
protected $mAffectedRows;
- /** @var int */
- private $mInsertId = null;
-
/** @var bool */
private $ignoreDupValOnIndex = false;
return oci_field_name( $stmt, $n );
}
- /**
- * This must be called after nextSequenceVal
- * @return null|int
- */
function insertId() {
- return $this->mInsertId;
+ $res = $this->query( "SELECT lastval_pkg.getLastval FROM dual" );
+ $row = $this->fetchRow( $res );
+ return is_null( $row[0] ) ? null : (int)$row[0];
}
/**
return preg_replace( '/.*\.(.*)/', '$1', $name );
}
- /**
- * Return the next in a sequence, save the value for retrieval via insertId()
- *
- * @param string $seqName
- * @return null|int
- */
- function nextSequenceValue( $seqName ) {
- $res = $this->query( "SELECT $seqName.nextval FROM dual" );
- $row = $this->fetchRow( $res );
- $this->mInsertId = $row[0];
-
- return $this->mInsertId;
- }
-
/**
* Return sequence_name if table has a sequence
*