create or replace procedure SumRow
begin
select count(table_name) from user_tables
End;
报错:PROCEDURE FOTS.SUMROW 编译错误
错误:PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
       
          ( ; is with authid as cluster compress order using compiled
          wrapped external deterministic parallel_enable pipelined
       The symbol "is" was substituted for "BEGIN" to continue.
行:2
文本:begin
错误:PLS-00103: Encountered the symbol "END" when expecting one of the following:
       
          . , @ ; for <an identifier>
          <a double-quoted delimited-identifier> group having intersect
          minus order partition start subpartition union where connect
          SAMPLE_
       The symbol ";" was substituted for "END" to continue.
行:4
文本:End;
PROCEDURE FOTS.SUMROW 编译错误
错误:PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
       
          ( ; is with authid as cluster compress order using compiled
          wrapped external deterministic parallel_enable pipelined
       The symbol "is" was substituted for "BEGIN" to continue.
行:2
文本:begin
错误:PLS-00103: Encountered the symbol "END" when expecting one of the following:
       
          . , @ ; for <an identifier>
          <a double-quoted delimited-identifier> group having intersect
          minus order partition start subpartition union where connect
          SAMPLE_
       The symbol ";" was substituted for "END" to continue.
行:4
文本:End;存储

解决方案 »

  1.   

    hr@ORCL> ed
    Wrote file afiedt.buf  1  create or replace procedure p_SumRow
      2  is
      3      v varchar2(20);
      4      begin
      5      select count(table_name) into v from user_tables;
      6*     end;
    hr@ORCL> /Procedure created.
      

  2.   

    create or replace procedure SumRow
    is
    begin
    execute immediate 'select count(table_name) from user_tables';
    End;
      

  3.   


    这是动态SQL的写法、适合在存储过程调用DDL语句、用在你这里我看不出任何有意义的东西
      

  4.   


    这是动态SQL的写法、适合在存储过程调用DDL语句、用在你这里我看不出任何有意义的东西是啊,得不到返回的值。
      

  5.   


    这是动态SQL的写法、适合在存储过程调用DDL语句、用在你这里我看不出任何有意义的东西是啊,得不到返回的值。我把重点放在编译通不过了
      

  6.   

    过程中查询语句通常用来做赋值操作
    select ... into ... from ...
      

  7.   

    create or replace procedure p_sumrow
    is
     v_name varchar2(20); 
    begin
    select count(table_name) into v_name from user_tables;
    end;