2012-11-10 26 views
7

Tôi đang cố gắng nhập khoảng 15.000 dòng dữ liệu vào bảng của mình bằng tập lệnh, nhưng khi tôi chạy tập lệnh, tôi nhận được cửa sổ bật lên yêu cầu tôi nhập biến thay thế.Trợ giúp của nhà phát triển SQL nhập biến số thay thế

Làm cách nào để ngăn điều đó xuất hiện để nó cho phép tôi nhập ngày?

Dưới đây là một số ví dụ về một số dòng dữ liệu mà tôi cần phải nhập

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'); 

Trả lời

7

Nhân vật dấu và (&) cho oracle mà bạn muốn sử dụng một biến thay thế.

Bạn có thể thoát khỏi những trong chèn của bạn bằng cách thêm vào trước tất cả ampersands với các ký tự thoát:

SET ESCAPE '\' 

INSERT INTO description 
(description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax \& Co','B'); 

hoặc vô hiệu hóa để quét cho biến thay thế hoàn toàn:

SET SCAN OFF 

INSERT INTO description 
(description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
('Fragile', 3385, 'Nosophobia Fabrication', 'Carfax & Co','B'); 

Để biết thêm thông tin, hãy thoải mái hãy xem: http://ss64.com/ora/syntax-escape.html

3

Ký tự và ký tự được hiểu là đầu của biến thay thế. Bạn có thể có thể tắt thay thế hoàn toàn bằng cách thực hiện

set define off; 

trước khi chạy báo cáo của bạn hoặc chỉ chấm dứt chuỗi ngay sau dấu và như thế nào trong

INSERT INTO description 
    (description, item_weight, pickup_customer, delivery customer, category) 
VALUES 
    ('Normal', 2525, 'Matriotism Plc', 'Carfax &'||' Co', 'A'); 
Các vấn đề liên quan