在存储过程中遇见一个merge into B(表名) using(select 1 as a,2 as b from dual) A on (B.xx=A.xx) when matched then update when not matched then insert 的语句,中间用到dbms_output.put_line打印了sql,在存储过程中执行是可以的,我单独把这条拿出来执行下,结果用dbms_output.put_line打印语句时出现错误
只能在存储过程中使用,sql中是用不了的,可以加BEGIN END 在sql 中使用 ,
BEGIN
DBMS_OUTPUT.put_line('123');
END ;
dbms_output.put_line本身就是个procedure,不带return,所以不能在sql中使用,只能在plsql块中使用