douyou7072 2016-04-20 11:02
浏览 54

Oracle Insert查询不起作用,也不会抛出任何错误

Hi I am new in Oracle .

I am trying to insert a record into a table using oracle in PHP. But it's not working ,also not throwing any error .

Below is my code . Please tell me where I am doing wrong .

$insertSQL= "INSERT INTO GL_USR_MAIL_FOLDER(FK_GLUSR_USR_ID, GL_USR_MAIL_FOLDER_NAME) VALUES (:USERDET,:FOLDERNAME) RETURNING GL_USR_MAIL_FOLDER_ID INTO :FOLDER_ID";
try{
  //  echo "try 111LL:L";
    $stid = oci_parse($dbh, $insertSQL);
    $e = oci_error($stid);  // For oci_execute errors pass the statement handle
    print htmlentities($e['message']);
}catch (Exception $ex) {
    GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Parsing of Query couldn't take place ","Parsing of Query couldn't take place for Query : 
 $sql", $ex,0);
}
try{
    //echo "try bindd";
    oci_bind_by_name($stid, ":USERDET", $postData['glusrid']);
    oci_bind_by_name($stid, ":FOLDERNAME", $postData['foldername']);
     oci_bind_by_name($stid, ":FOLDER_ID", $folderid, 8, OCI_B_INT);
     $e = oci_error($stid);  // For oci_execute errors pass the statement handle
    print htmlentities($e['message']);
} catch (Exception $ex) {
    GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Binding of Query couldn't take place ","Binding of Query couldn't take place for Query : 
 $sql", $ex,0);
}
try{
    $s = oci_execute($stid);
    if(!$s){

        $e = oci_error($stid); 
    print htmlentities($e['message']);
    }
    print_r($s);echo "after execute";


    oci_commit($dbh);

}catch(Exception $ex){
    GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Execution of Query couldn't take place ","Execution of Query couldn't take place for Query : 
 $sql", $ex,0);
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?