Oracle創(chuàng)建相關(guān)的存儲過程最有效的方法
以下的文章主要介紹的是Oracle創(chuàng)建相關(guān)的存儲過程的簡單方法,其中包括Oracle在創(chuàng)建的過程本身自帶的編譯錯(cuò)誤的警告,以及Oracle創(chuàng)建的過程帶有那些的編譯是錯(cuò)誤等相關(guān)內(nèi)容的介紹。
連接到:
- Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
- With the Partitioning, OLAP and Oracle Data Mining options
- JServer Release 9.2.0.1.0 - Production
- SQL> create or replace procedure get_news(
- aid in varchar2,atitle in varchar2)
- as
- begin
- select * from cf_news
- end;
- /
警告: Oracle創(chuàng)建的過程帶有編譯錯(cuò)誤。
- SQL> create or replace procedure get_news(
- aid in varchar2 ,atitle in varchar2)
- as
- beging
- /
警告: 創(chuàng)建的過程帶有編譯錯(cuò)誤。
- SQL> create or replace procedure get_news(
- aid in varchar2)
- as
- begin
- select * from cf_news;
- end;
- /
警告: 創(chuàng)建的過程帶有編譯錯(cuò)誤。
- SQL> create or replace procedure get_news
- 2 as
- 3 begin
- 4 select * from cf_news;
- 5 end;
- 6 /
警告: Oracle創(chuàng)建的過程帶有編譯錯(cuò)誤
- SQL> show errors;
PROCEDURE GET_NEWS 出現(xiàn)錯(cuò)誤:
- LINE/COL ERROR
4/1 PLS-00428: 在此 SELECT 語句中缺少 INTO 子句
- SQL> create or replace procedure get_news
- 2 as
- 3 aa number;
- 4 begin
- 5 select count(*) into aa from cf_news;
- 6 end;
- 7 /
過程已創(chuàng)建。
- SQL> create or replace procedure get_news
- 2 as
- 3 aa number;
- 4 begin
- 5 select count(*) into aa from cf_news;
- 6 dbms_outpub.put_line('aa='||aa);
- 7 end;
- 8 /
警告: 創(chuàng)建的過程帶有編譯錯(cuò)誤。
- SQL> show errors;
PROCEDURE GET_NEWS 出現(xiàn)錯(cuò)誤:
- LINE/COL ERROR
6/1 PLS-00201: 必須說明標(biāo)識符 'DBMS_OUTPUB.PUT_LINE'
6/1 PL/SQL: Statement ignored
- SQL> create or replace procedure get_news
- 2 as
- 3 aa number;
- 4 begin
- 5 select count(*) into aa from cf_news;
- 6 dbms_output.put_line('aa='||aa);
- 7 end;
- 8 /
過程已Oracle創(chuàng)建。
- SQL> set serverout on;
- SQL> execute get_news;
- aa=3
PL/SQL 過程已成功完成。
文章出自: http://www.programbbs.com/doc/class10-2.htm
【編輯推薦】
- Oracle數(shù)據(jù)庫與DM的強(qiáng)制訪問的不同之處
- Oracle 語句的優(yōu)化規(guī)則中的相關(guān)項(xiàng)目
- Oracle管理員用戶是什么?
- Oracle DRCP與PHP的不同之處
- Oracle EM管理 MySQL的實(shí)操方案