Java

本类阅读TOP10

·使用MyEclipse开发Struts框架的Hello World!(录像1)
·hibernate配置笔记
·AOP编程入门--Java篇
·linux下Tomcat 5.0.20 与 Apache 2 安装/集成/配置
·在win2003下整合了整合Tomcat5.5+ apache_2.0.53+ mod_jk_2.0.47.dll
·构建Linux下IDE环境--Eclipse篇
·Jsp 连接 mySQL、Oracle 数据库备忘(Windows平台)
·ASP、JSP、PHP 三种技术比较
·Tomcat5.5.9的安装配置
·AWT GUI 设计笔记(二)

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
简单的Oracle存储过程的创建方法(菜鸟级)

作者:未知 来源:月光软件站 加入时间:2005-5-13 月光软件站


连接到:
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  /

过程已创建。

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  /

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

SQL> show errors;
PROCEDURE GET_NEWS 出现错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
6/1      PLS-00201: 必须说明标识符 '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  /

过程已创建。

SQL> set serverout on;
SQL> execute get_news;
aa=3

PL/SQL 过程已成功完成。




相关文章

相关软件