以下的文章主要是对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 过程已成功完成。
相关文章
标签:Oracle