3,491
社区成员
发帖
与我相关
我的任务
分享
SQL>
SQL> create or replace function test2 return clob is
2 v_clob CLOB;
3 begin
4 DECLARE
5 v_char VARCHAR2(100);
6 BEGIN
7 v_char := '123456';
8 dbms_lob.createtemporary(v_clob,TRUE);
9 dbms_lob.append(v_clob,v_char);
10 end;
11 return v_clob;
12 END test2;
13 /
Function created
SQL> set serverout on;
SQL> declare
2 c clob;
3 d clob;
4 begin
5 select test2 into c from dual;
6 dbms_output.put_line('c=' || c);
7 d := test2;
8 dbms_output.put_line('d=' || d);
9 end;
10 /
c=123456
d=123456
PL/SQL procedure successfully completed
SQL> drop function test2;
Function dropped
SQL>
create or replace function test_1905101 return varchar2 is
v_str clob;
begin
dbms_lob.createtemporary(v_str,true);
dbms_lob.append(v_str,'12345');
return(v_str);
end ;
select test_1905101() from dual;