Yii Framework Forum: Yii::app()->Db->Getlastinsertid() With Oracle - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii::app()->Db->Getlastinsertid() With Oracle get last insert id with OCI driver. Rate Topic: -----

#1 User is offline   codesutra 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 596
  • Joined: 15-March 11
  • Location:India

Posted 22 August 2013 - 04:01 AM

Hello Everyone,

I am developing my current project with oracle database and Yii framework (of course ;)).
But as i have seen Driver classes for OCI in Yii framework that there is no any method written to get last insert id with oracle database.

For, now i have created a method in my model class which is returning me Last Insert id just after saving Active Record.

	$connection=Yii::app()->db;
			$sql = "select {$this->sequenceName}.currval from dual";
			$result = $connection->createCommand($sql)->queryRow();
			
			return $result['CURRVAL'];


So, is this possible to include this method with oci driver classes for Yii framework in coming versions.

Or anybody can suggest something about it then it would be appreciated.

Since, in the present time high scaled projects are also building in Yii Framework and most of the People are preferring backend with Oracle.So,i would to suggest or i can say request to Yii dev team to make some better changes with oci driver classes to make it more powerful and useful.

Personally i have started working with oracle + Yii framework and feeling that there should be some improvement we need to do here with it.

Don't you guys think that who had faced some problem with oracle and Yii.

Looking for some suggestions and feedback.

Thanks in Advance !! :)
CodeSutra
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users