oracle数据库无法insert

浏览:1668 发布日期:2017/02/22
5.0.0 - 致命 - 未处理
版本5.0.6 数据库ORACLE
http://www.thinkphp.cn/topic/46110.html

controller:
public function test()
{
$list=model('Nc');
$su=$list->add();
return $su;
}

model Nc.PHP:

public function add(){
$data = ['ecn_no' => 9, 'user_name' => 'foo'];
session('se_test','212121');//session成功
$sus=$this->insert($data);
return $sus;
}


1、没有创建“序号”和“触发器”后进行insert就报错:
[IM001] PDOException in Connection.php line 800
SQLSTATE[IM001]: Driver does not support this function: driver does not support lastInsertId()
2、创建“序号”和“触发器”后进行insert就报错:[10502] BindParamException in Connection.php line 512
Error occurred when binding parameters ':__data__ecn_no',
另外,“触发器”指定了“序列”。
3、以上两种报错情况未实现写入任何数据.
4、用原生代码Db::execute('insert into……可以正常写入数据(已创建“序号”“触发器”);
5、在创建“序号”“触发器”后,select、update、delete都正常运行。
评论(
后面还有条评论,点击查看>>