php 链接oracle,插入数据的问题,用sql执行就可以,用php的oci插入就不行,但oci可以查询
代码:$qry="begin";$qry+="insertintotab_productusert(operator_id,loginid,password,name,r...
代码:
$qry = "begin";
$qry +=" insert into tab_productuser t(operator_id,loginid,password,name,remark,comp_id,user_type,enable,ch_id) VALUES ( 1,1,1,1,1,1,1,1,1);
";
$qry +=" end;";
$stmt = oci_parse($conn, $qry);
$a = oci_execute($stmt,OCI_DEFAULT); //执行
$e = oci_error(); // For oci_connect errors pass no handle
echo htmlentities($e['message']);
$committed = oci_commit($conn);
oci_free_statement($stmt);
oci_close($conn); //关闭连接
}catch(Exception $ex) {
echo 111;exit;
var_dump($ex);exit;
} 展开
$qry = "begin";
$qry +=" insert into tab_productuser t(operator_id,loginid,password,name,remark,comp_id,user_type,enable,ch_id) VALUES ( 1,1,1,1,1,1,1,1,1);
";
$qry +=" end;";
$stmt = oci_parse($conn, $qry);
$a = oci_execute($stmt,OCI_DEFAULT); //执行
$e = oci_error(); // For oci_connect errors pass no handle
echo htmlentities($e['message']);
$committed = oci_commit($conn);
oci_free_statement($stmt);
oci_close($conn); //关闭连接
}catch(Exception $ex) {
echo 111;exit;
var_dump($ex);exit;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询