1

当我尝试创建以下过程时,我遇到了这个错误:“PLS-00103:在期待以下之一时遇到符号“=”:“我找不到我出错的地方,请帮我解决这个问题。

 create or replace PROCEDURE  ProcName
(inTid IN VARCHAR2,outtxnstatus OUT CHAR,outrowcount OUT NUMBER,outretvalue OUT NUMBER) AS
   CURSOR c1 IS 
    select TXN_STATUS from OP_TTERMINALMASTER where TERMINAL_ID = inTid and TXN_STATUS = 'N' FOR UPDATE OF TXN_STATUS;
    outrowcount:= sql%rowcount;
    BEGIN
    if outrowcount = 1 then
      Open c1;
      fetch c1 into outtxnstatus;   
      update OP_TTERMINALMASTER set TXN_STATUS = 'Y' where current of c1;
      outretvalue := 5;
      CLOSE c1;
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
      outretvalue := -5;
    END;
4

1 回答 1

3

我认为它在这里(之前BEGIN):

outrowcount:= sql%rowcount;

您在正确的位置声明了一个光标,但是,在begin您尝试分配的部分sql%rowcount之前,甚至在打开光标之前......

尝试

 create or replace PROCEDURE  ProcName
(inTid IN VARCHAR2,outtxnstatus OUT CHAR,outrowcount OUT NUMBER,outretvalue OUT NUMBER) AS

   BEGIN

     update OP_TTERMINALMASTER set TXN_STATUS = 'Y'
      where TERMINAL_ID = inTid and TXN_STATUS = 'N';

     outrowcount:= sql%rowcount;

      outretvalue := 5;
   EXCEPTION
    WHEN NO_DATA_FOUND THEN
      outretvalue := -5;
   END;
于 2012-11-06T06:07:38.813 回答