database SQL Developer 帮助输入替换变量
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/13326513/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQL Developer help enter a substitution variable
提问by Michael
I'm trying to enter around 15,000 lines of data into my table using a script, but when I run the script I get a popup window asking me to enter a substitution variable.
我正在尝试使用脚本将大约 15,000 行数据输入到我的表中,但是当我运行脚本时,我得到一个弹出窗口,要求我输入替换变量。
How do I stop that from popping up so that it allows me to enter the date?
我如何阻止它弹出,以便它允许我输入日期?
Here are some examples of some lines of data that I need to enter
以下是我需要输入的一些数据行的一些示例
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');
回答by Lynn Crumbling
The ampersand character (&) tells oracle that you want to use a substitution variable.
& 符号 (&) 告诉 oracle 您要使用替换变量。
You either escape these in your inserts by prepending all ampersands with the escape character:
您可以通过在所有&符号前加上转义字符来在插入中转义这些:
SET ESCAPE '\'
INSERT INTO description 
 (description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
 ('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax \& Co','B');
or disable for scanning for substitution variables entirely:
或完全禁用扫描替换变量:
SET SCAN OFF
INSERT INTO description 
 (description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
 ('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax & Co','B');
For more information, feel free to check out: http://ss64.com/ora/syntax-escape.html
有关更多信息,请随时查看:http: //ss64.com/ora/syntax-escape.html
回答by Daniel Calliess
The ampersand character is interpreted as the beginning of a substitution variable. You can either turn off substitution completely by executing
&符号字符被解释为替换变量的开始。您可以通过执行完全关闭替换
set define off;
before running your statements or just end the string immediately after the ampersand like in
在运行您的语句之前或只是在&符号之后立即结束字符串,例如
INSERT INTO description 
  (description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
  ('Normal', 2525, 'Matriotism Plc', 'Carfax &'||' Co', 'A');

