• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP oci_commit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中oci_commit函数的典型用法代码示例。如果您正苦于以下问题:PHP oci_commit函数的具体用法?PHP oci_commit怎么用?PHP oci_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了oci_commit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: actualizarPassword

function actualizarPassword($newpassword, $token)
{
    $conex = DataBase::getInstance();
    $stid = oci_parse($conex, "UPDATE FISC_USERS SET \n\t\t\t\t\t\tpassword=:newpassword\n\t\t\t\t    WHERE token=:token");
    if (!$stid) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    // Realizar la lógica de la consulta
    oci_bind_by_name($stid, ':token', $token);
    oci_bind_by_name($stid, ':newpassword', $newpassword);
    $r = oci_execute($stid, OCI_NO_AUTO_COMMIT);
    if (!$r) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    $r = oci_commit($conex);
    if (!$r) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    oci_free_statement($stid);
    // Cierra la conexión Oracle
    oci_close($conex);
    return true;
}
开发者ID:vanckruz,项目名称:draftReports,代码行数:29,代码来源:Controller_password.php


示例2: insertImage

function insertImage($conn, $photo_id, $owner_name, $descriptive_info, $thumbnail, $photo)
{
    $photo_blob = oci_new_descriptor($conn, OCI_D_LOB);
    $thumbnail_blob = oci_new_descriptor($conn, OCI_D_LOB);
    $subject = $descriptive_info[0];
    $place = $descriptive_info[1];
    $date_time = $descriptive_info[2];
    $description = $descriptive_info[3];
    $permitted = $descriptive_info[4];
    $sql = 'INSERT INTO images (photo_id, owner_name, permitted, subject, place,
		timing, description, thumbnail, photo) VALUES (:photoid, :ownername,
		:permitted, :subject, :place, TO_DATE(:datetime, \'MM/DD/YYYY\'), :description, empty_blob(),
		empty_blob()) returning thumbnail, photo into :thumbnail, :photo';
    $stid = oci_parse($conn, $sql);
    oci_bind_by_name($stid, ':photoid', $photo_id);
    oci_bind_by_name($stid, ':ownername', $owner_name);
    oci_bind_by_name($stid, ':permitted', $permitted);
    oci_bind_by_name($stid, ':subject', $subject);
    oci_bind_by_name($stid, ':place', $place);
    oci_bind_by_name($stid, ':datetime', $date_time);
    oci_bind_by_name($stid, ':description', $description);
    oci_bind_by_name($stid, ':thumbnail', $thumbnail_blob, -1, OCI_B_BLOB);
    oci_bind_by_name($stid, ':photo', $photo_blob, -1, OCI_B_BLOB);
    $res = oci_execute($stid, OCI_DEFAULT);
    if ($thumbnail_blob->save($thumbnail) && $photo_blob->save($photo)) {
        oci_commit($conn);
    } else {
        oci_rollback($conn);
    }
    oci_free_statement($stid);
    $photo_blob->free();
    $thumbnail_blob->free();
}
开发者ID:ismailmare,项目名称:Photoshare,代码行数:33,代码来源:uploadDB.php


示例3: obtenerDenuncias

function obtenerDenuncias($denuncias)
{
    //$ids = transformarArray($denuncias,",");
    $conex = DataBase::getInstance();
    foreach ($denuncias as $key => $value) {
        $conex = DataBase::getInstance();
        $stid = oci_parse($conex, "UPDATE FISC_DENUNCIAS SET \n\t\t\t\t\tASIGNACION=1 , ASIGNADOPOR=:sesion_cod\n\t\t\t\t\tWHERE ID_DENUNCIA=:ID");
        if (!$stid) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        // Realizar la lógica de la consulta
        oci_bind_by_name($stid, ':ID', $value);
        oci_bind_by_name($stid, ':sesion_cod', $_SESSION['USUARIO']['codigo_usuario']);
        $r = oci_execute($stid, OCI_NO_AUTO_COMMIT);
        if (!$r) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        $r = oci_commit($conex);
        if (!$r) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        oci_free_statement($stid);
        // Cierra la conexión Oracle
        oci_close($conex);
    }
    return true;
}
开发者ID:vanckruz,项目名称:draftReports,代码行数:33,代码来源:Controller_Denuncia_Correo.php


示例4: createPicturesTableIfNeeded

 function createPicturesTableIfNeeded($db)
 {
     $table = 'pictures';
     $index = 'description_indx';
     $table = strtoupper($table);
     if (!$this->tableExists($db, $table)) {
         $sql = "CREATE TABLE {$table} (\n                picture_id int PRIMARY KEY,\n                name VARCHAR2(50) NOT NULL,\n                creation_date DATE,\n                upload_date DATE,\n                description VARCHAR2(1000),\n                image ORDSYS.ORDImage,\n                image_sig  ORDSYS.ORDImageSignature,\n                artist_fk int REFERENCES artists(artist_id),\n                artist_safety_level int,\n                museum_ownes_fk int REFERENCES museums(museum_id),\n                museum_exhibits_fk int REFERENCES museums(museum_id),\n                museum_exhibits_startdate date,\n                museum_exhibits_enddate date,\n                owner_fk int REFERENCES owners(owner_id)\n                )";
         $this->executeSql($db, $sql);
         $this->createSequence($db, $table . "_seq");
     }
     $index = strtoupper($index);
     if (!$this->indexExists($db, $index)) {
         //create index for description
         $sql = "begin\n                        ctx_ddl.create_preference('mylexer', 'BASIC_LEXER' );\n                        ctx_ddl.set_attribute ( 'mylexer', 'mixed_case', 'NO' );\n                    end;";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         $sql = "begin\n                        ctx_ddl.create_preference('mystore', 'BASIC_STORAGE');\n                       ctx_ddl.set_attribute('mystore', 'I_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'K_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'R_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'N_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'I_INDEX_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'P_TABLE_CLAUSE', 'tablespace INDX');\n                    end;";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         $sql = "CREATE INDEX myIndex ON PICTURES ( DESCRIPTION )\n                       INDEXTYPE IS CTXSYS.CONTEXT\n                       PARAMETERS ( 'LEXER mylexer STORAGE mystore SYNC (ON COMMIT)' )";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         oci_commit($db);
     }
 }
开发者ID:GeorgesAlkhouri,项目名称:openmuseum,代码行数:28,代码来源:DbTableCreator.php


示例5: commit

 public function commit()
 {
     set_error_handler(static::getErrorHandler());
     $isSuccess = oci_commit($this->resource);
     restore_error_handler();
     return $isSuccess;
 }
开发者ID:jpina,项目名称:oci8,代码行数:7,代码来源:Oci8Connection.php


示例6: Execute

 /**
  *Execução de comandos padrões de consulta a banco (SELECT, INSERT, UPDATE, DELETE, CREATE...)
  *@name execute()
  *@return ObjectQuery
  **/
 public function Execute($argSql, $argName = NAME_QUERY)
 {
     global $result;
     # call the connect database method
     $sqli = $this->conn->__conecta();
     # instancia as variáveis
     $this->sql = $argSql;
     $this->name = $argName;
     //echo $this->dbtype;
     //exit;
     if ($this->conn->typedb == "mysql") {
         try {
             # execute sql command
             $result = $sqli->query($this->sql);
             # fecha a conexão com o banco de dados
             $sqli->close();
             # retorno do método
             return $result;
         } catch (Exception $e) {
             echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n";
         }
     }
     if ($this->conn->typedb == "oracle") {
         try {
             $result = oci_parse($sqli, $this->sql);
             oci_execute($result);
             oci_commit($sqli);
             OCILogoff($sqli);
             return $result;
         } catch (Exception $e) {
             OCILogoff($sqli);
             echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n";
         }
     }
 }
开发者ID:stagoe90,项目名称:InfinitumEprocurement,代码行数:40,代码来源:queryBuilder.class.php


示例7: uploadImage

/**
 * Insert image data to database (recoreded_data and thumbnail).
 * First generate an unique image id, then insert image to recoreded_data and resized image to thubnail along with 
 *   other given data
 */
function uploadImage($conn, $sensor_id, $date_created, $description)
{
    $image_id = generateId($conn, "images");
    if ($image_id == 0) {
        return;
    }
    $image2 = file_get_contents($_FILES['file_image']['tmp_name']);
    $image2tmp = resizeImage($_FILES['file_image']);
    $image2Thumbnail = file_get_contents($image2tmp['tmp_name']);
    // encode the stream
    $image = base64_encode($image2);
    $imageThumbnail = base64_encode($image2Thumbnail);
    $sql = "INSERT INTO images (image_id, sensor_id, date_created, description, thumbnail, recoreded_data)\n                      VALUES(" . $image_id . ", " . $sensor_id . ", TO_DATE('" . $date_created . "', 'DD/MM/YYYY hh24:mi:ss'), '" . $description . "', empty_blob(), empty_blob())\n                       RETURNING thumbnail, recoreded_data INTO :thumbnail, :recoreded_data";
    $result = oci_parse($conn, $sql);
    $recoreded_dataBlob = oci_new_descriptor($conn, OCI_D_LOB);
    $thumbnailBlob = oci_new_descriptor($conn, OCI_D_LOB);
    oci_bind_by_name($result, ":recoreded_data", $recoreded_dataBlob, -1, OCI_B_BLOB);
    oci_bind_by_name($result, ":thumbnail", $thumbnailBlob, -1, OCI_B_BLOB);
    $res = oci_execute($result, OCI_DEFAULT) or die("Unable to execute query");
    if ($recoreded_dataBlob->save($image) && $thumbnailBlob->save($imageThumbnail)) {
        oci_commit($conn);
    } else {
        oci_rollback($conn);
    }
    oci_free_statement($result);
    $recoreded_dataBlob->free();
    $thumbnailBlob->free();
    echo "New image is added with image_id ->" . $image_id . "<br>";
}
开发者ID:ayunita,项目名称:OOSproject,代码行数:34,代码来源:datacuratorFunction.php


示例8: commit

 public function commit()
 {
     if (!oci_commit($this->_dbh)) {
         throw OCI8Exception::fromErrorInfo($this->errorInfo());
     }
     return true;
 }
开发者ID:nvdnkpr,项目名称:symfony-demo,代码行数:7,代码来源:OCI8Connection.php


示例9: commit

 public function commit()
 {
     parent::commit();
     if (!oci_commit($this->link)) {
         $this->set_driver_error(null, PDO::ERRMODE_EXCEPTION, 'commit');
     }
     $this->setAttribute(PDO::ATTR_AUTOCOMMIT, 1);
     return true;
 }
开发者ID:Deepab23,项目名称:clinic,代码行数:9,代码来源:oci.php


示例10: commit

 public function commit()
 {
     if (!oci_commit($this->dbh)) {
         $error = oci_error($this->dbh);
         throw new \Exception($error['message'], $error['code']);
     }
     $this->executeMode = OCI_COMMIT_ON_SUCCESS;
     return true;
 }
开发者ID:df-arif,项目名称:df-core,代码行数:9,代码来源:PdoAdapter.php


示例11: commit

 public function commit()
 {
     if (oci_commit($this->connection)) {
         $this->autoCommit = true;
     } else {
         $e = oci_error($this->connection);
         throw new Sabel_Db_Exception_Driver($e["message"]);
     }
 }
开发者ID:reoring,项目名称:sabel,代码行数:9,代码来源:Driver.php


示例12: gagal__

 function gagal__($param, $conn)
 {
     $sql = "DELETE FROM MART_MST_CHKOUT WHERE MART_WR_ID = '{$param}'";
     $parse = oci_parse($conn, $sql);
     $exe = oci_execute($parse);
     if ($exe) {
         oci_commit($conn);
     }
 }
开发者ID:weltesdeveloper,项目名称:weltesmart,代码行数:9,代码来源:model_checkout.php


示例13: insertRow

 public function insertRow($t, $reqBody)
 {
     foreach ($reqBody as $req) {
         $i = "INSERT INTO {$t} VALUES ('{$req->id}', null, null, '{$req->l_name}', sysdate)";
         $resource = oci_parse($this->conn, $i);
         oci_execute($resource, OCI_NO_AUTO_COMMIT);
     }
     oci_commit($this->conn);
     //echo $req->id . "\n";
 }
开发者ID:romanovsky-vassar,项目名称:vassarapi-dev-0.1.0,代码行数:10,代码来源:OracleDatabase.php


示例14: UpdateRecord

 public function UpdateRecord($sql, $conn)
 {
     $status_update = false;
     $parse = oci_parse($sql, $conn);
     $execute = oci_execute($parse);
     if ($execute) {
         oci_commit($conn);
         $status_update = true;
     } else {
         oci_rollback($conn);
         $status_update = false . oci_error();
     }
     return $status_update;
 }
开发者ID:weltesdeveloper,项目名称:WeltesFinance,代码行数:14,代码来源:DbConfig.php


示例15: insert

 public function insert($sql)
 {
     $this->last_query = $sql;
     $this->stid = oci_parse($this->connection, $sql);
     oci_bind_by_name($this->stid, ":ID", $id, 32);
     $result = oci_execute($this->stid);
     $this->affected_rows_value = oci_num_rows($this->stid);
     $committed = oci_commit($this->connection);
     //$commited, result from commit currently not analyzed, space for improvement
     if ($result) {
         return $id;
     } else {
         return -1;
     }
 }
开发者ID:sergey-chekriy,项目名称:CRUD_Objects_Oracle_MySQL,代码行数:15,代码来源:oracle_database.php


示例16: ajouterContenu

 public function ajouterContenu($id_fichier, $contenu)
 {
     $sql = "INSERT INTO CONTENU(ID_FICHIER,CONTENU) VALUES ({$id_fichier}, EMPTY_CLOB())\n        RETURNING CONTENU INTO :CONTENU_loc";
     $conn = oci_connect("DBA_PARAPHEUR", "12345678", "XE");
     $stmt = oci_parse($conn, $sql);
     // Creates an "empty" OCI-Lob object to bind to the locator
     $clob = oci_new_descriptor($conn, OCI_D_LOB);
     // Bind the returned Oracle LOB locator to the PHP LOB object
     oci_bind_by_name($stmt, ":CONTENU_loc", $clob, -1, OCI_B_CLOB);
     // Execute the statement using , OCI_DEFAULT - as a transaction
     oci_execute($stmt, OCI_DEFAULT) or die("Unable to execute query\n");
     // Now save a value to the clob
     if (!$clob->save($contenu)) {
         // On error, rollback the transaction
         oci_rollback($conn);
     } else {
         // On success, commit the transaction
         oci_commit($conn);
     }
 }
开发者ID:svast,项目名称:start,代码行数:20,代码来源:Contenu.php


示例17: conectarse

 public function conectarse()
 {
     $Cn = oci_pconnect($this->udb, $this->pdb, $this->server, 'AL32UTF8');
     if (!$Cn) {
         $e = oci_error();
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
         return "noconex";
     } else {
         $qry = oci_parse($Cn, "alter session set NLS_TERRITORY='SPAIN'");
         $qry = oci_execute($qry);
         @oci_commit($Cn);
         $qry = oci_parse($Cn, "alter session set NLS_DATE_FORMAT='DD-MM-YYYY HH24:MI:SS'");
         $qry = oci_execute($qry, OCI_DEFAULT);
         @oci_commit($Cn);
         $qry = oci_parse($Cn, "alter session set NLS_TIMESTAMP_FORMAT='DD-MM-YYYY HH24:MI:SS'");
         $qry = oci_execute($qry, OCI_DEFAULT);
         @oci_commit($Cn);
         /* $qry = oci_parse($Cn, "alter session set NLS_NUMERIC_CHARACTERS='.,'");
            $qry = oci_execute($qry, OCI_DEFAULT);
            @oci_commit($Cn);*/
         return $Cn;
     }
     //by Robyir
 }
开发者ID:robyirloreto,项目名称:clinicamobile,代码行数:24,代码来源:config.php


示例18: oracle_query

function oracle_query($query, $connection)
{
    $resultMessage = "";
    $resultSet = null;
    $result = 0;
    $sth = oci_parse($connection, $query);
    if (!$sth) {
        //error de parseo.
        $e = oci_error($connection);
        $resultSet = null;
        error_log($query . ": " . htmlentities($e['message']), 0);
        return -1;
    }
    //echo $query;
    $results = oci_execute($sth, OCI_DEFAULT);
    if (!$results) {
        //error de ejecuci�n.
        $e = oci_error($sth);
        error_log($query . ":- " . htmlentities($e['message']), 0);
        return -1;
    }
    oci_commit($connection);
    return $sth;
}
开发者ID:hackdracko,项目名称:Facturacion-Kio,代码行数:24,代码来源:conexion.php


示例19: queryInternal

 /**
  * Executes a query against connected database.
  * Rises SqlQueryException on any database error.
  * <p>
  * When object $trackerQuery passed then calls its startQuery and finishQuery
  * methods before and after query execution.
  *
  * @param string                            $sql Sql query.
  * @param array                             $binds Array of binds.
  * @param \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery Debug collector object.
  *
  * @return resource
  * @throws \Bitrix\Main\Db\SqlQueryException
  */
 protected function queryInternal($sql, array $binds = null, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery = null)
 {
     $this->connectInternal();
     if ($trackerQuery != null) {
         $trackerQuery->startQuery($sql, $binds);
     }
     $result = oci_parse($this->resource, $sql);
     if (!$result) {
         if ($trackerQuery != null) {
             $trackerQuery->finishQuery();
         }
         throw new SqlQueryException("", $this->getErrorMessage($this->resource), $sql);
     }
     $executionMode = $this->transaction;
     /** @var \OCI_Lob[] $clob */
     $clob = array();
     if (!empty($binds)) {
         $executionMode = OCI_DEFAULT;
         foreach ($binds as $key => $val) {
             $clob[$key] = oci_new_descriptor($this->resource, OCI_DTYPE_LOB);
             oci_bind_by_name($result, ":" . $key, $clob[$key], -1, OCI_B_CLOB);
         }
     }
     if (!oci_execute($result, $executionMode)) {
         if ($trackerQuery != null) {
             $trackerQuery->finishQuery();
         }
         throw new SqlQueryException("", $this->getErrorMessage($result), $sql);
     }
     if (!empty($binds)) {
         if (oci_num_rows($result) > 0) {
             foreach ($binds as $key => $val) {
                 if ($clob[$key]) {
                     $clob[$key]->save($binds[$key]);
                 }
             }
         }
         if ($this->transaction == OCI_COMMIT_ON_SUCCESS) {
             oci_commit($this->resource);
         }
         foreach ($binds as $key => $val) {
             if ($clob[$key]) {
                 $clob[$key]->free();
             }
         }
     }
     if ($trackerQuery != null) {
         $trackerQuery->finishQuery();
     }
     $this->lastQueryResult = $result;
     return $result;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:66,代码来源:oracleconnection.php


示例20: commit_transaction

 public function commit_transaction()
 {
     oci_commit($this->connection);
 }
开发者ID:tmlsoft,项目名称:main,代码行数:4,代码来源:db_oracle.php



注:本文中的oci_commit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP oci_connect函数代码示例发布时间:2022-05-15
下一篇:
PHP oci_close函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap