这是我在命令行中写的代码;create or replace procedure insertPerson(pname in varchar2,page in number) as
begin
insert into persons values (person_seq.nextVal,pname,page);
end insertPerson;代码没问题,但就是执行不了,怎么回事?我需要要在dos窗口执行,不是在PL*SQL上执行的。
请问各位大侠该如何处理?

解决方案 »

  1.   

    在dos窗口执行,不是在PL*SQL上执行的
    都一样的操作啊
    C:\Documents and Settings\Administrator>sqlplusSQL*Plus: Release 9.2.0.1.0 - Production on 星期二 12月 1 10:38:51 2009Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.请输入用户名:  scott
    请输入口令:
      

  2.   


    SQL> create or replace procedure insertPerson(pname in varchar2,page in number)
    as
      2  begin
      3  insert into persons values (person_seq.nextVal,pname,page);
      4  end insertPerson;
      5  /警告: 创建的过程带有编译错误。SQL>
    注意第五行的/------------------------------------------------------------------------------
    Blog: http://blog.csdn.net/tianlesoftware
    网上资源: http://tianlesoftware.download.csdn.net
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
    Q Q 群:62697716 
      

  3.   

    dos命令行也是用sql plus登录,才可以执行的
      

  4.   

    存储过程、type、函数需要加 "/"表示执行。一般的select 、i/u/d就不要了。
      

  5.   

    1.先打开windows的doc窗口。
    cmd
    2.用你要执行过程的用户登录数据库。
    sqlplus username/passwd@网络服务名称   
    3.编译过程,即把你过程的sql语句copy到命令行中,然后回车,并输入/,如下。
    create or replace procedure insertPerson(pname in varchar2,page in number) as
    begin
    insert into persons values (person_seq.nextVal,pname,page);
    end insertPerson;
    /
    4.然后执行过程。
    begin
    insertPerson(参数,参数);
    end;
    /
      

  6.   

    按照5楼的做法,我在PLSQL中编译执行没有问题