W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PECL CUBRID >= 8.4.1)
cubrid_lob2_import — 從文件導(dǎo)入 BLOB/CLOB 數(shù)據(jù)
cubrid_lob2_import(resource $lob_identifier, string $file_name): bool
cubrid_lob2_import() 函數(shù)用于保存 文件中的 BLOB/CLOB 數(shù)據(jù)的內(nèi)容。要使用此函數(shù),您必須使用 cubrid_lob2_new() 或從 CUBRID 數(shù)據(jù)庫中獲取 lob 對象 第一。如果文件已存在,則操作將失敗。 此函數(shù)不會影響 lob 對象的光標位置。 它操作整個 lob 對象。
lob_identifier
作為 cubrid_lob2_new() 結(jié)果的 Lob 標識符或從結(jié)果集中獲取。
filename
要導(dǎo)入 BLOB/CLOB 數(shù)據(jù)的文件名。它還支持文件的路徑。
成功時返回 true, 或者在失敗時返回 false。
示例 #1 cubrid_lob2_export() example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES (?, ?)");
cubrid_bind($req, 1, 1);
$lob = cubrid_lob2_new($conn, "clob");
cubrid_lob2_import($lob, "doc_1.txt");
cubrid_lob2_bind($req, 2, $lob, 'CLOB'); // or cubrid_lob2_bind($req, 2, $lob);
cubrid_execute($req);
cubrid_lob2_close($lob);
cubrid_disconnect($conn);
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: