萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> oracle教程 >> 簡單的Oracle存儲過程的創建方法

簡單的Oracle存儲過程的創建方法

連接到:

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(
2 aid in varchar2,atitle in varchar2)
3 as
4 begin
5 select * from cf_news
6 end;
7 /

警告: 創建的過程帶有編譯錯誤。

SQL> create or replace procedure get_news(
2 aid in varchar2 ,atitle in varchar2)
3 as
4 beging
5 /

警告: 創建的過程帶有編譯錯誤。

SQL> create or replace procedure get_news(
2 aid in varchar2)
3 as
4 begin
5 select * from cf_news;
6 end;
7 /

警告: 創建的過程帶有編譯錯誤。

SQL> create or replace procedure get_news
2 as
3 begin
4 select * from cf_news;
5 end;
6 /

警告: 創建的過程帶有編譯錯誤。

SQL> show errors;
PROCEDURE GET_NEWS 出現錯誤:

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 /

  • 共2頁:
  • 上一頁
  • 1
  • 2
  • 下一頁
copyright © 萬盛學電腦網 all rights reserved