全部博文(136)
分类: Oracle
2008-06-06 16:43:41
DBMS_LOB.CREATETEMPORARY ( lob_loc IN OUT NOCOPY [ BLOB | CLOB CHARACTER SET ANY_CS ], cache IN BOOLEAN, dur IN PLS_INTEGER := DBMS_LOB.SESSION); |
Parameter |
Description |
---|---|
lob_loc |
Receives the locator to the LOB. |
cache |
Specifies whether the LOB should be read into the buffer cache. |
dur |
Controls the duration of the LOB. The dur argument can be one of these two named constants:
|
DECLARE temp_clob CLOB; temp_blob BLOB; BEGIN --Assigning a value to a null CLOB or BLOB variable causes --PL/SQL to implicitly create a session-duration temporary --LOB for you. temp_clob :=' http://yuechaotian.cublog.cn'; temp_blob := HEXTORAW('7A'); END; |
PROCEDURE DBMS_LOB.FREETEMPORARY ( lob_loc IN OUT NOCOPY [ BLOB | CLOB CHARACTER SET ANY_CS ]); |
DECLARE
temp_clob CLOB; temp_blob BLOB; BEGIN --Assigning a value to a null CLOB or BLOB variable causes --PL/SQL to implicitly create a session-duration temporary --LOB for you. temp_clob :=' '; temp_blob := HEXTORAW('7A'); DBMS_LOB.FREETEMPORARY(temp_clob); DBMS_LOB.FREETEMPORARY(temp_blob); END; |
SQL> DECLARE 2 temp_clob CLOB; 3 temp_clob2 CLOB; 4 BEGIN 5 temp_clob := 'http://yuechaotian.cublog.cn'; 6 temp_clob2 := 'http://yuexingtian.cublog.cn'; 7 8 dbms_output.put_line(temp_clob); 9 dbms_output.put_line(temp_clob2); 10 11 DBMS_LOB.FREETEMPORARY(temp_clob); 12 13 -- temp_clob2 is freed 14 temp_clob2 := temp_clob; 15 dbms_output.put_line(temp_clob2); 16 END; 17 / http://yuechaotian.cublog.cn http://yuexingtian.cublog.cn DECLARE * ERROR 位于第 1 行: ORA-22275: 指定的 LOB 定位器无效 |
DBMS_LOB.ISTEMPORARY ( lob_loc IN [ BLOB | CLOB CHARACTER SET ANY_CS ]) RETURN INTEGER; |
SQL> DECLARE
2 temp_clob CLOB; 3 n_is_temporary number(1); 4 BEGIN 5 temp_clob := 'http://yuechaotian.cublog.cn'; 6 7 n_is_temporary := dbms_lob.istemporary(temp_clob); 8 dbms_output.put_line('n_is_temporary :' || n_is_temporary); 9 10 DBMS_LOB.FREETEMPORARY(temp_clob); 11 END; 12 / n_is_temporary :1 PL/SQL 过程已成功完成。 |