【发布时间】:2018-11-28 12:02:35
【问题描述】:
创建一个名为 insert_credit 的过程,通过将 5 个输入作为参数传递,将值插入到 credit_card 表中。
程序名称:insert_credit
输入参数:credit_id with data type as number,credit_card_number with data type as varchar,credit_card_expire with data type as varchar,holder_name with data type as varchar and card_type with data type as varchar
使用的表:credit_card
我写了这个:
CREATE OR REPLACE PROCEDURE insert_credit(
p_credit_id IN credit_card.credit_id%TYPE,
p_credit_card_number IN credit_card.credit_card_number%TYPE,
p_credit_card_expire IN credit_card.credit_card_expire%TYPE,
p_holder_name IN credit_card.holder_name%TYPE,
p_card_type IN credit_card.card_type%TYPE)
IS
BEGIN
INSERT INTO credit_card ("credit_id", "credit_card_number", "credit_card_expire", "holder_name","card_type")
VALUES (p_credit_id, p_credit_card_number,p_credit_card_expire,
p_holder_name,p_card_type);
COMMIT;
END;
/
在执行时我得到:
“警告:创建的过程存在编译错误。”
【问题讨论】:
-
您可以通过运行
show errors查看有关错误的详细信息。但是尽量去掉列名周围的",除非您在创建该表时也使用了它们