oraoracle ora 243444 成功 但出现编译错误

他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)ORA-24344;是怎么回事啊
[问题点数:40分]
ORA-24344;是怎么回事啊
[问题点数:40分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2016年10月优秀大版主优秀小版主
2017年1月 总版技术专家分月排行榜第二
2016年1月 Oracle大版内专家分月排行榜第一2015年6月 Oracle大版内专家分月排行榜第一2015年4月 Oracle大版内专家分月排行榜第一2015年3月 Oracle大版内专家分月排行榜第一2015年2月 Oracle大版内专家分月排行榜第一2014年6月 Oracle大版内专家分月排行榜第一2009年11月 Oracle大版内专家分月排行榜第一2009年10月 Oracle大版内专家分月排行榜第一
2015年9月 Oracle大版内专家分月排行榜第二2015年7月 Oracle大版内专家分月排行榜第二2015年1月 Oracle大版内专家分月排行榜第二2014年12月 Oracle大版内专家分月排行榜第二2014年11月 Oracle大版内专家分月排行榜第二2014年8月 Oracle大版内专家分月排行榜第二2014年7月 Oracle大版内专家分月排行榜第二2014年5月 Oracle大版内专家分月排行榜第二2010年1月 Oracle大版内专家分月排行榜第二2009年9月 Oracle大版内专家分月排行榜第二
匿名用户不能发表回复!|sql - Oracle Apex: ORA-24344 Success with compilation error - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I am currently working on an oracle database in APEX.
First of all, I do not have access to any tools. I can only use what is provided in apex.oracle.com and I am writing the script in NotePad++ before uploading it over there. It's a school assignment, so I am not allowed to use any other tools, even if there is something that would make things easier.
I am creating a long script that creates a bunch of tables in a database, creates a bunch of records in every table, and creates all the constraints. This part works fine. Now i must create several functions and procedures in the same script, after the other stuff.
Every single time I try to create one, I get this: ORA-24344: success with compilation error
Also, the other instructions in the script after this error are not executed. Everything that was before the error works fine.
Here is one of the functions that create this error:
CREATE OR REPLACE FUNCTION SP_03Recherche (titre_art VARCHAR2, nom_aut VARCHAR2, type_art VARCHAR2)
RETURN CURSOR
CURSOR articles (p_titre_art VARCHAR2, p_nom_aut VARCHAR2, p_type_art VARCHAR2) IS
SELECT * FROM BI_Articles INNER JOIN (BI_ArticlesAuteurs INNER JOIN BI_Auteurs ON BI_ArticlesAuteurs.AuteurID = BI_Auteurs.AuteurID) ON BI_Articles.ISBN = BI_ArticlesAuteurs.ISBN
WHERE (Titre LIKE p_titre_art) AND ((Nom LIKE p_nom_aut) OR (Prenom LIKE p_nom_aut)) AND TypeArticle LIKE type_
RETURN articles(titre_art, nom_aut, type_art);
sys_refcursor is the data type that you seemingly want to return.
That's a generic type for a weak ref cursor.
My guess is that you want something like
CREATE OR REPLACE FUNCTION SP_03Recherche (
p_titre_art VARCHAR2,
p_nom_aut VARCHAR2,
p_type_art VARCHAR2
RETURN sys_
FOR select *
from bi_articles art
inner join BI_ArticlesAuteurs art_auth
on (art.isbn = art_auth.isbn)
inner join BI_Auteurs auth
on (art_auth.auteurID = auth.auteurID)
where titre LIKE p_titre_art
and (nom LIKE p_nom_auth or
prenum LIKE p_nom_auth)
and typearticle LIKE type_
Now, a few suggestions
Doing a select * is almost always a bad idea.
Particularly when you are joining multiple tables.
Do you really, really want the structure of the result set to change every time someone adds an additional column to any of three tables?
That seems unlikely.
Use aliases everywhere.
Looking at the code, I have no idea what table titre comes from.
Or nom or prenum or typearticle.
Use aliases to identify which table a column comes from.
That makes your code clearer and makes it more robust when additional tables or columns are added in the future which may have the same column names (multiple entities might have a nom column for example).
178k17256291
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Upcoming Events
ends Mar 27
Stack Overflow works best with JavaScript enabled猜你会喜欢....oracle建立触发器 success with compilation error_百度知道
oracle建立触发器 success with compilation error
person是一张表
想对person里的id实现自增功能
自定义一个序列:
CREATE SEQUENCE example_sequence
INCREMENT BY 1
START WITH 1
NOMAXVALUE
建立一个触发器
CREATE TRIGGER HK2 BEFORE
INSERT ON &person& FOR EACH ROW ...
我有更好的答案
BEFORE INSERT ON &person& FOR EACH ROW WHEN (new.id is null) 中new.nextval into CREATE TRIGGER HK2 BEFORE INSERT ON person FOR EACH ROW begin
select example_sequence.id is null应该是多此一举吧?:new
编译错误.如果你是 sql plus 下面执行的。你可以通过
show error
来查看 具体内部报的编译错误信息。你那个
创建的时候,
CREATE TABLE
方式创建的么?
我是用navicat建的表,我导出sql看了一下CREATE TABLE &DATATABLE&.&person& (&id& NUMBER(2) NOT NULL 有双引号
你把&person&两边的号去掉就OK了!语法没问题!
INSERT ON &DATATABLE&.&person& FOR EACH ROW WHEN (new.&id& is null)beginselect example_sequence1.nextval into: new.&id&[Err] ORA-24344: success with compilation error
INSERT ON DATATABLE.person FOR EACH ROW WHEN (new.id is null)beginselect example_sequence1.nextval into: new.
1条折叠回答
为您推荐:
其他类似问题
触发器的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。

我要回帖

更多关于 oracle ora 24344 的文章

 

随机推荐