gpt4 book ai didi

sql - Oracle存储过程运行错误

转载 作者:行者123 更新时间:2023-12-02 11:11:48 26 4
gpt4 key购买 nike

我正在尝试针对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

关于sql - Oracle存储过程运行错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30988291/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com