I am trying to run the following command in Oracle 11g but keep getting an error of 'commmand not properly ended'. I am new to Oracle and I haven't been able to find anything about insert multiple value sets (unless they are selected from a table which in this case they are not)....
INSERT INTO category (catcode, catdesc)
VALUES ('BUS', 'BUSINESS'),
('CHN', 'CHILDREN'),
('COK', 'COOKING'),
('COM', 'COMPUTER'),
('FAL', 'FAMILY LIFE'),
('FIT', 'FITNESS'),
('SEH', 'SELF HELP'),
('LIT', 'LITERATURE'),
('CHN', 'CHILDREN'),
('BUS', 'BUSINESS');
If this syntax is completely off, then how can I insert multiple values in one statement?
Try like this,
INSERT ALL
INTO category (catcode, catdesc) VALUES ('BUS', 'BUSINESS')
INTO category (catcode, catdesc) VALUES ('CHN', 'CHILDREN')
INTO category (catcode, catdesc) VALUES ('COK', 'COOKING')
INTO category (catcode, catdesc) VALUES ('COM', 'COMPUTER')
INTO category (catcode, catdesc) VALUES ('FAL', 'FAMILY LIFE')
INTO category (catcode, catdesc) VALUES ('FIT', 'FITNESS')
INTO category (catcode, catdesc) VALUES ('SEH', 'SELF HELP')
INTO category (catcode, catdesc) VALUES ('LIT', 'LITERATURE')
INTO category (catcode, catdesc) VALUES ('CHN', 'CHILDREN')
INTO category (catcode, catdesc) VALUES ('BUS', 'BUSINESS')
SELECT * FROM DUAL;
Refer here for more in detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With