我正在尝试使用脚本在我的表中输入大约15,000行数据,但是当我运行脚本时,我会弹出一个窗口,要求我输入替换变量。
如何阻止弹出,以便我可以输入日期?
以下是我需要输入的一些数据行的一些示例
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Normal', 4771, 'Carfax & Co', 'Matriotism Plc', 'A');
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Normal', 2525, 'Matriotism Plc', 'Carfax & Co', 'A');
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Normal', 693, 'Matriotism Plc', 'Sylph Fabrication', 'A');
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Fragile', 2976, 'Nosophobia Fabrication', 'Carfax & Co', 'B');
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax & Co','B');
答案 0 :(得分:8)
&符号(&)告诉oracle你要使用替换变量。
您可以通过在所有&符号前加上转义字符来解除插入过程中的这些:
SET ESCAPE '\'
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax \& Co','B');
或禁用以完全扫描替换变量:
SET SCAN OFF
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax & Co','B');
欲了解更多信息,请随时查看: http://ss64.com/ora/syntax-escape.html
答案 1 :(得分:3)
&符号被解释为替换变量的开头。您可以通过执行
完全关闭替换set define off;
在运行你的语句之前或者只是在&符号之后立即结束字符串,如
INSERT INTO description
(description, item_weight, pickup_customer, delivery customer, category)
VALUES
('Normal', 2525, 'Matriotism Plc', 'Carfax &'||' Co', 'A');