Oracle 存储过程 运行 错误
Oracle Stored Procedure Running Errors
我正在尝试我的第一个 Oracle 存储过程,因为我以前的插入语句不起作用。我已经在谷歌上搜索了几个小时,但似乎没有人对我的具体问题进行更正。
我只想添加记录:/
我的代码如下:
CREATE OR REPLACE Insert_classifieds
(val_date IN TABLENAME.Addate%type,
val_category IN TABLENAME.Category%type,
val_user IN TABLENAME.Username%type,
val_ phone IN TABLENAME.Phonenbr%type,
val_email IN TABLENAME.Email%type,
val_shortDes IN TABLENAME.Description%type,
val_longDes IN TABLENAME.Fulldescription%type ,
val_newstandardid out TABLENAME.Classid%type
)
as num_standardid number;
begin
select t_class_seq.nextval into num_standardid from dual;
INSERT INTO TABLENAME (Classid, Addate, Category, Username, Phonenbr, Email, Description, Fulldescription)
VALUES (num_standardid, val_date, val_category, val_user, val_phone, val_email, val_shortDes, val_longDes);
commit;
val_newstandardid := num_standardid;
end;
如果您尝试创建过程,则语法为(您缺少 "PROCEDURE" 关键字):
CREATE OR REPLACE PROCEDURE Insert_classifieds
所以我的问题是 val_phone 有一个 space 和一些修正。
决赛:
CREATE OR REPLACE PROCEDURE Insert_classifieds
(val_date TABLENAME.Addate%type,
val_category TABLENAME.Category%type,
val_user TABLENAME.Username%type,
val_phone TABLENAME.phonenbr%type,
val_email TABLENAME.Email%type,
val_shortDes TABLENAME.Description%type,
val_longDes TABLENAME.Fulldescription%type)
as num_classid number;
begin
select t_class_seq.nextval into num_classid from dual;
INSERT INTO TABLENAME (Classid, Addate, Category, Username, Phonenbr, Email, Description, Fulldescription)
values (num_classid, val_date, val_category, val_user, val_phone, val_email, val_shortDes, val_longDes);
commit;
end;
我正在尝试我的第一个 Oracle 存储过程,因为我以前的插入语句不起作用。我已经在谷歌上搜索了几个小时,但似乎没有人对我的具体问题进行更正。
我只想添加记录:/
我的代码如下:
CREATE OR REPLACE Insert_classifieds
(val_date IN TABLENAME.Addate%type,
val_category IN TABLENAME.Category%type,
val_user IN TABLENAME.Username%type,
val_ phone IN TABLENAME.Phonenbr%type,
val_email IN TABLENAME.Email%type,
val_shortDes IN TABLENAME.Description%type,
val_longDes IN TABLENAME.Fulldescription%type ,
val_newstandardid out TABLENAME.Classid%type
)
as num_standardid number;
begin
select t_class_seq.nextval into num_standardid from dual;
INSERT INTO TABLENAME (Classid, Addate, Category, Username, Phonenbr, Email, Description, Fulldescription)
VALUES (num_standardid, val_date, val_category, val_user, val_phone, val_email, val_shortDes, val_longDes);
commit;
val_newstandardid := num_standardid;
end;
如果您尝试创建过程,则语法为(您缺少 "PROCEDURE" 关键字):
CREATE OR REPLACE PROCEDURE Insert_classifieds
所以我的问题是 val_phone 有一个 space 和一些修正。
决赛:
CREATE OR REPLACE PROCEDURE Insert_classifieds
(val_date TABLENAME.Addate%type,
val_category TABLENAME.Category%type,
val_user TABLENAME.Username%type,
val_phone TABLENAME.phonenbr%type,
val_email TABLENAME.Email%type,
val_shortDes TABLENAME.Description%type,
val_longDes TABLENAME.Fulldescription%type)
as num_classid number;
begin
select t_class_seq.nextval into num_classid from dual;
INSERT INTO TABLENAME (Classid, Addate, Category, Username, Phonenbr, Email, Description, Fulldescription)
values (num_classid, val_date, val_category, val_user, val_phone, val_email, val_shortDes, val_longDes);
commit;
end;