改成 create or replace procedure p_total_content(small number,big number,n varchar) is big1 number; small1 number; begin commit; set transaction use rollback segment RBS1; if big<small then small1:=big; big1:=small; else small1:=small; big1:=big; end if; execute immediate 'INSERT /*+APPEND */ INTO temp_total_content NOLOGGING select my_content.content_id,my_content.action_id,my_content.total_byte,my_content.total_second, temp_content.content_name content_name from f_action_record:1 my_content, fv_content_union temp_content where my_content.content_id = temp_content.content_id and my_content.action_time between :2 and :3' using in n,in small1,in big1; commit; end p_total_content; 编译通过,但是调用过程的时候sql command not properly ended ora-06512 line 14, 不解
create or replace procedure p_total_content(small number,big number,n varchar) is
big1 number;
small1 number;
begin
commit;
set transaction use rollback segment RBS1;
if big<small then
small1:=big;
big1:=small;
else
small1:=small;
big1:=big;
end if;
execute immediate 'INSERT /*+APPEND */ INTO temp_total_content NOLOGGING
select my_content.content_id,my_content.action_id,my_content.total_byte,my_content.total_second, temp_content.content_name content_name
from f_action_record:1 my_content,
fv_content_union temp_content
where my_content.content_id = temp_content.content_id and my_content.action_time between :2 and :3' using in n,in small1,in big1;
commit;
end p_total_content;
编译通过,但是调用过程的时候sql command not properly ended ora-06512 line 14,
不解
你先把这个做为变量给另一个不行么?
如:a:=b||'01'
然后就符合你的要求了
你a:=b||n
n=‘01’
n的值随时变,你也可以把他做为入参我不明白,和你的要求有什么区别