The following twelve CUBRID PHP API functions are now implemented in CUBRID PHP API version 8.4.1.004 in addition to five existing functions to allow PHP developers to perform various operations on Large Object (LOB) data.

Description

cubrid_lob2_bind() is used to bind BLOB/CLOB datas to a corresponding question mark placeholder in the SQL statement that was passed to cubrid_prepare(). If $bind_value_type is not given, string will be BLOB as the default. But if you use cubrid_lob2_new() before, $bind_value_type will be consistent with $type in cubrid_lob2_new() as the default.

3. cubrid_lob2_export

Description

cubrid_lob2_export() is used to save the contents of BLOB/CLOB data to a file. To use this function, you must use cubrid_lob2_new() or fetch a lob object from CUBRID database first. If the file has existed, it will fail. This function will not influence the cursor position of the lob object. It operates the entire lob object.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

filename

File name you want to store BLOB/CLOB data. It also supports the path of the file.

4. cubrid_lob2_import

Description

cubrid_lob2_import() is used to save the contents of BLOB/CLOB data from a file. To use this function, you must use cubrid_lob2_new() or fetch a LOB object from CUBRID database first. This function will not influence the cursor position of the lob object. It operates the entire lob object.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

filename

File name you want to import BLOB/CLOB data. It also supports the path of the file.

7. cubrid_lob2_tell

Description

cubrid_lob2_tell() is used to tell the cursor position of the LOB object.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

Return values

It will return the cursor position on the LOB object when it processes successfully.

FALSE on failure.

8. cubrid_lob2_tell64

Tell the cursor position of the LOB object.

Description

string cubrid_lob2_tell64 ( resource $lob_identifier )

cubrid_lob2_tell64() is used to tell the cursor position of the LOB object. If the size of a lob object is larger than an integer data can be stored, you can use this function and it will return the position information as a string.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

Return values

It will return the cursor position on the LOB object as a string when it processes successfully.

10. cubrid_lob2_seek64

Description

cubrid_lob2_seek64() is used to move the cursor position of a lob object by the value set in the offset argument, to the direction set in the origin argument. If the $offset you want to move is larger than an integer data can be stored, you can use this function.

To set the origin argument, you can use CUBRID_CURSOR_FIRST to set the cursor position moving forward offset units from the first beginning. In this case, offset must be a positive value.

If you use CUBRID_CURSOR_CURRENT for origin, you can move forward or backward. and offset can be positive or negative.

If you use CUBRID_CURSOR_LAST for origin, you can move backward offset units from the end of LOB object and offset only can be positive.

NOTE:

If you use this function to move the cursor position of the lob object, you should pass $offset as a string.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

offset

Number of units you want to move the cursor.

origin

This parameter can be the following values:

CUBRID_CURSOR_FIRST: move forward from the first beginning.

CUBRID_CURSOR_CURRENT: move forward or backward from the current position.

11. cubrid_lob2_size

Description

Parameters

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

Return values

It will return the size of the LOB object when it processes successfully.

FALSE on failure.

12. cubrid_lob2_size64

Get a lob object's size.

Description

string cubrid_lob2_size64 ( resource $lob_identifier )

cubrid_lob2_size64() is used to get the size of a LOB object. If the size of a lob object is larger than an integer data can be stored, you can use this function and it will return the size as a string.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.

Return values

It will return the size of the LOB object as a string when it processes successfully.

FALSE on failure.

13. cubrid_lob2_close

Close LOB object.

Description

bool cubrid_lob2_close ( resource $lob_identifier )

cubrid_lob2_close() is used to close LOB object returned from cubrid_lob2_new() or get from the result set.

Parameters

lob_identifier

Lob identifier as a result of cubrid_lob2_new() or get from the result set.