The ISTEMPORARY function checks whether the locator points to a temporary LOB.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_LOB.ISTEMPORARY (
lob_loc IN BLOB)
RETURN INTEGER;
DBMS_LOB.ISTEMPORARY (
lob_loc IN CLOB CHARACTER SET ANY_CS)
RETURN INTEGER;
Parameters
lob_loc: the locator of the LOB. For more information, see Considerations.
Return values
The return value is 1 if the LOB exists and is a temporary one. The value is 0 if the LOB does not exist or is not a temporary one. The value is NULL if the locator is NULL.
Considerations
When you use FREETEMPORARY to release a temporary LOB, the locator of the LOB will not be set to NULL. If the locator of the LOB has been released but not explicitly reset to NULL, ITEMPORARY returns 0.
Examples
obclient> SELECT DBMS_LOB.ISTEMPORARY(TO_CLOB('asd')) FROM DUAL;
+--------------------------------------+
| DBMS_LOB.ISTEMPORARY(TO_CLOB('ASD')) |
+--------------------------------------+
| 1 |
+--------------------------------------+
1 row in set
obclient> SELECT DBMS_LOB.ISTEMPORARY(TO_CLOB('30303031')) FROM DUAL;
+-------------------------------------------+
| DBMS_LOB.ISTEMPORARY(TO_BLOB('30303031')) |
+-------------------------------------------+
| 1 |
+-------------------------------------------+
1 row in set
obclient> SET SERVEROUTPUT ON;
Query OK, 0 rows affected
obclient> DELIMITER /
obclient> DECLARE
my_clob CLOB;
BEGIN
my_clob := to_clob('abcd');
DBMS_LOB.FREETEMPORARY(my_clob);
DBMS_OUTPUT.PUT_LINE('istemp: ' || DBMS_LOB.ISTEMPORARY(my_clob));
END;
/
Query OK, 1 row affected
istemp: 0