我是存储过程的新手。我正在尝试运行存储过程并收到这些错误:我收到 PLS-00103:在预期以下情况之一时遇到符号“SELECT”:开始函数杂注过程... PLS-00103:遇到符号“RETURN”时期待以下之一: * & = - + < / > at is mod remaining not rem then... 我尝试搜索导致这些错误的原因以及与此类似的示例,但结果还不够。关于为什么会发生这些错误的任何线索?这是代码:
CREATE OR REPLACE PROCEDURE LIST_ACTIONS_CHECK_ADD
(
LISTNAME IN VARCHAR2
) AS
BEGIN
DECLARE CNT NUMBER;
SELECT COUNT(LIST_NAME) INTO CNT FROM LISTS_MASTER WHERE LIST_NAME = LISTNAME;
IF (CNT > 0)
RETURN 1
ELSE
RETURN 0
END IF;
END LIST_ACTIONS_CHECK_ADD;
新代码:
CREATE OR REPLACE PROCEDURE LIST_ACTIONS_CHECK_ADD
(
P_LISTNAME IN VARCHAR2
)
AS
L_CNT NUMBER;
BEGIN
SELECT COUNT(LIST_NAME)
INTO L_CNT
FROM LISTS_MASTER
WHERE LIST_NAME = P_LISTNAME;
IF (L_CNT > 0)
RETURN 1;
ELSE
RETURN 0;
END IF;
END LIST_ACTIONS_CHECK_ADD;