try :CREATE OR REPLACE PROCEDURE Get_Info(
status   VARCHAR2(255),
active   NUMBER,
AllCount OUT NUMBER,
Online   OUT NUMBER,
Error    OUT NUMBER)
AS
BEGIN
    select AllCount := count(*) from tr_info;
    select Online   := count(*) from tr_info where active=active;
    select Error    := count(*) from tr_status where status like '%'||status||'%';
END Get_Info;

解决方案 »

  1.   

    //错误如下
    Compilation errors for PROCEDURE DEV.GET_INFOError: PLS-00103: 出现符号 "STATUS"在需要下列之一时:
            ( ; is with authid as
              cluster compress order using compiled wrapped external
              deterministic parallel_enable pipelined
           符号 "is" 被替换为 "STATUS" 后继续。
    Line: 2
    Text: status VARCHAR2(255);Error: PLS-00103: 出现符号 "NUMBER"在需要下列之一时:
            := . ( @ % ; not null
              range default character
    Line: 4
    Text: AllCount OUT NUMBER;
      

  2.   

    CREATE OR REPLACE PROCEDURE Get_Info 
    (
    status   VARCHAR2,
    active   NUMBER,
    AllCount OUT NUMBER,
    Online   OUT NUMBER,
    Error    OUT NUMBER)
    is
    BEGIN
    ...
      

  3.   

    Online    是关键字 最好换个写法
      

  4.   

    //修改代码如下
    CREATE OR REPLACE PROCEDURE Get_Info(
    status VARCHAR2,
    active NUMBER,
    AllCount OUT NUMBER,
    Online OUT NUMBER,
    Error OUT NUMBER)
    AS
    BEGIN
    select AllCount := count(*) from tr_info;
    select Online := count(*) from tr_info where active=active;
    select Error := count(*) from tr_status where status like '%'||status||'%';
    END Get_Info;//--------------------------------------------错误如下Compilation errors for PROCEDURE DEV.GET_INFOError: PL/SQL: ORA-00923: 未找到要求的 FROM 关键字
    Line: 9
    Text: select AllCount := count(*) from tr_info;Error: PL/SQL: SQL Statement ignored
    Line: 9
    Text: select AllCount := count(*) from tr_info;Error: PL/SQL: ORA-00923: 未找到要求的 FROM 关键字
    Line: 10
    Text: select Online := count(*) from tr_info where active=active;Error: PL/SQL: SQL Statement ignored
    Line: 10
    Text: select Online := count(*) from tr_info where active=active;Error: PL/SQL: ORA-00923: 未找到要求的 FROM 关键字
    Line: 11
    Text: select Error := count(*) from tr_status where status like '%'||status||'%';Error: PL/SQL: SQL Statement ignored
    Line: 11
    Text: select Error := count(*) from tr_status where status like '%'||status||'%';
    他未找到要求的 FROM 关键字 
    可我的status active AllCount Online Error 都有过定义
      

  5.   

    BEGIN
    select count(*) into AllCount   from tr_info;
    select count(*) into Online  from tr_info where active=active;
    select count(*) into Error   from tr_status where status like '%'||status||'%';
    END Get_Info;
      

  6.   

    还有一个很大的问题
    输入参数不要与列名相同
    如果想同
    select count(*) into Online  from tr_info where active=active;
    相当于查询表的所有记录数