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;
什麼是正確的方法是什麼?