Difference between revisions of "PostgreSQLDatabase.DeleteLargeObject"

From Xojo Documentation

 
Line 35: Line 35:
 
db.DeleteLargeObject(objectID)
 
db.DeleteLargeObject(objectID)
 
Catch error As DatabaseException
 
Catch error As DatabaseException
   MessageDialog.Show("DB Error: " + error.Message)
+
   MessageBox("DB Error: " + error.Message)
 
End Try
 
End Try
 
</rbcode>
 
</rbcode>

Latest revision as of 02:11, 30 August 2019

Method

PostgreSQLDatabase.DeleteLargeObject(oid As Integer)

Supported for all project types and targets.

Deletes the large object identified by oid.

Notes

PostgreSQL requires that all large object operations be performed inside of a transaction. Therefore, you must start a transaction before you perform your first large object operation:

db.ExecuteSQL("BEGIN TRANSACTION")

After you have performed your last large object operation, you should close the transaction, like this:

db.ExecuteSQL("END TRANSACTION")

Please see the PostgreSQLLargeObject class for information on how to work with large objects.

Example

Delete a large object:

// db is a previously connected PostgreSQLDatabase
// objectID is a reference to a previously created large object
Try
db.DeleteLargeObject(objectID)
Catch error As DatabaseException
MessageBox("DB Error: " + error.Message)
End Try