1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 数据库 - 正文

君子好学,自强不息!

以下的文章主要是对Oracle创建存储过程的正确方法的介绍,其中包括有相关的连接,与在实际操中,那些的问题是值得我们注意的,以下就是具体方案的描述,希望在你今后的学习中会有所帮助。

连接到:

Oracle9iEnterpriseEditionRelease9.2.0.1.0-Production 
WiththePartitioning,OLAPandOracleDataMiningoptions 
JServerRelease9.2.0.1.0-Production 
SQL>createorreplaceprocedureget_news( 
2 aidinvarchar2,atitleinvarchar2) 
3 as 
4 begin 
5 select*fromcf_news 
6 end; 
7 / 

警告: Oracle创建的过程带有编译错误。

SQL>createorreplaceprocedureget_news( 
2 aidinvarchar2,atitleinvarchar2) 
3 as 
4 beging 
5 /

警告: 创建的过程带有编译错误。

SQL>createorreplaceprocedureget_news( 
2 aidinvarchar2) 
3 as 
4 begin 
5 select*fromcf_news; 
6 end; 
7 /

警告: 创建的过程带有编译错误。

SQL>createorreplaceprocedureget_news 
2 as 
3 begin 
4 select*fromcf_news; 
5 end; 
6 /

警告: Oracle创建的过程带有编译错误。

PROCEDURE GET_NEWS 出现错误:

LINE/COLERROR 

4/1 PLS-00428: 在此 SELECT 语句中缺少 INTO 子句

SQL>createorreplaceprocedureget_news 
2 as 
3 aanumber; 
4 begin 
5 selectcount(*)intoaafromcf_news; 
6 end; 
7 /

过程已创建。

SQL>createorreplaceprocedureget_news 
2 as 
3 aanumber; 
4 begin 
5 selectcount(*)intoaafromcf_news; 
6 dbms_outpub.put_line('aa='||aa); 
7 end; 
8 /

警告: Oracle创建的过程带有编译错误。

SQL>showerrors; 

PROCEDURE GET_NEWS 出现错误:

LINE/COLERROR

PLS-00201: 必须说明标识符 ‘DBMS_OUTPUB.PUT_LINE’

6/1 PL/SQL:Statementignored 
SQL>createorreplaceprocedureget_news 
2 as 
3 aanumber; 
4 begin 
5 selectcount(*)intoaafromcf_news; 
6 dbms_output.put_line('aa='||aa); 
7 end; 
8 /

过程已Oracle创建。

SQL>setserverouton; 
SQL>executeget_news; 
aa=3

PL/SQL 过程已成功完成。

本文来源:1818IP

本文地址:https://www.1818ip.com/post/11386.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。