Pdo\Pgsql::lobUnlink
(PHP 8 >= 8.4.0)
Pdo\Pgsql::lobUnlink — Deletes the large object
説明
Deletes a large object from the database identified by OID.
注意: This function, and all manipulations of the large object, must be called and carried out within a transaction.
パラメータ
oid
- A large object identifier.
例
例1 Pdo\Pgsql::lobUnlink() example
This example unlinks a large object from the database prior to deleting the row that references it from the blobs table are used in the examples of Pdo\Pgsql::lobCreate() and Pdo\Pgsql::lobOpen().
<?php
$db = new PDO('pgsql:dbname=test host=localhost', $user, $pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->beginTransaction();
$db->pgsqlLOBUnlink($oid);
$stmt = $db->prepare("DELETE FROM BLOBS where ident = ?");
$stmt->execute(array($some_id));
$db->commit();
?>
参考
- Pdo\Pgsql::lobCreate() - Creates a new large object
- Pdo\Pgsql::lobOpen() - Opens an existing large object stream
- pg_lo_create() - ラージオブジェクトを生成する
- pg_lo_open() - ラージオブジェクトをオープンする
+add a note
User Contributed Notes
There are no user contributed notes for this page.
↑ and ↓ to navigate •
Enter to select •
Esc to close
Press Enter without
selection to search using Google