--创建
create or replace procedure p1 as
begin
dbms_output.put_line('hello world! this is the first procedure');
end p1;--执行
begin
p1;
end;
或者
exec p1创建是可以的,为什么不能在pl/sql里执行pL/sql存储过程
create or replace procedure p1 as
begin
dbms_output.put_line('hello world! this is the first procedure');
end p1;--执行
begin
p1;
end;
或者
exec p1创建是可以的,为什么不能在pl/sql里执行pL/sql存储过程
exec p1提示不是这样吗
选中PL/SQL块在执行
begin
p1;
end;报的错
执行exec p1,提示“无效的sql语句”
我找到原因了,是字符串乱码了!编译后是“dbms_output.put_line('hello?world!?this?is?the?first?procedure');??”
1.创建完后加上一个“/”即时编译一下,然后在pl/sql里要用begin p1; end;不能用exec p1,那个在command里能用
2.判断编译成功与否,看下图的对与叉
加上命令 set serveroutput on
如
set serveroutput on
exec p1;