The ISTEMPORARY function checks whether a LOB instance is temporary.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
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 LOB locator of the LOB instance. For more information, see Overview of DBMS_LOB.
Return value
If the LOB instance is temporary and exists, the return value is 1. If the LOB instance is not temporary or does not exist, the return value is 0. If the given LOB locator is NULL, the return value is NULL.
Considerations
When you call the FREETEMPORARY function to release a temporary LOB instance, the LOB locator is not set to NULL. If the LOB instance is released but the LOB locator is not explicitly set to NULL, the ISTEMPORARY function 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
