第一次写oracle的存储过程,都快把我逼疯了
问题1:这一段sp有什么错啊?硬是说“编译不通过”把我搞得莫名其妙
create or replace procedure sp_test
(id in integer,name in varchar(10))
as
begin
insert into testtable(oid,name) values(id,name);
end;
说明,tasttable是有的,并且单独执行insert语句
insert into testtable (oid,name) values(2,'n2')
一切正常
问题2:这个存储过程该怎么调用啊?
CREATE OR REPLACE procedure SP_ENTITY_GET_UNIQUE_ID
(
id_string in varchar2,
id_return out int
)
AS
begin
update SYS_TABLE_ID set NEXT_ID=NEXT_ID+STEP where tablename=id_string;
select NEXT_ID into id_return from SYS_TABLE_ID where tablename=id_string;
end;
把那句调用的exec语句告诉我。
回答以上问题者,我将不胜感激,谢谢谢谢谢谢谢谢