创建oracle存储过程出错:创建的过程带有编译错误!帮忙! SQL> ed 已写入 file afiedt.buf
1 create or replace procedure AddUser( 2 id number, 3 userName varchar2, 4 userPwd varchar2) 5 as 6 begin 7 insert into users values(id,userName,userPwd) 8* end AddUser; SQL> /
警告: 创建的过程带有编译错误。
SQL> show errors; PROCEDURE ADDUSER 出现错误:
LINE/COL ERROR -------- ----------------------------- 7/1 PL/SQL: SQL Statement ignored 7/47 PL/SQL: ORA-00933: SQL 命令未正确结束 8/12 PLS-00103: 出现符号 "end-of-file"在需要下列之一时: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
SQL>
帮忙看看这个是什么错误!找了半天了也找不到答案,急死我了!
------解决方案--------------------
SQL code
改为:
create or replace procedure AddUser(id number,
userName varchar2,
userPwd varchar2) as
begin
insert into users values (id, userName, userPwd);
commit;
end AddUser;
------解决方案-------------------- 如果user表多于三个字段,最好表名后面要指明字段 create or replace procedure AddUser(id number, userName varchar2, userPwd varchar2) as begin insert into users(id, userName, userPwd) values (id, userName, userPwd); commit; end AddUser;
------解决方案-------------------- SQL insert 语句后面没分号。