DECLARE
PROCEDURE create_rule(
p_rule_type_key IN VARCHAR2,
p_key IN VARCHAR2,
p_activation IN DATE,
p_termination IN DATE,
p_description IN VARCHAR2
)
IS
CURSOR cur_rules (pc_rule_type_key IN VARCHAR2, pc_key IN VARCHAR2)
IS
SELECT rule_type_key
FROM ino_offers.rules
WHERE rule_type_key = pc_rule_type_key
AND key = pc_key;
BEGIN
OPEN cur_rules (p_rule_type_key, p_key);
p_description2 IN VARCHAR2;
FETCH cur_rules INTO p_description2;
IF (cur_rules%NOTFOUND) THEN
INSERT
INTO rules
(
RULE_TYPE_KEY,
KEY,
ACTIVATION,
TERMINATION,
DESCRIPTION,
CHANGED
)
VALUES
(
p_rule_type_key,
p_key,
p_activation,
p_termination,
p_description,
SYSDATE
);
END IF;
CLOSE cur_rules;
END;
BEGIN
create_rule(?, ?, ?, ?, ?);
END;
但我得到:
PLS-00103: Encountered the symbol "IN" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "IN" to continue.
问题在这里:
OPEN cur_rules (p_rule_type_key, p_key);
p_description2 IN VARCHAR2;
什么是正确的方法?