INSERT ALL in Oracle SQL
adi26Oct 22 2012 — edited Oct 22 2012My following script worked to insert rows in Oracle SQL -
INSERT ALL
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Kiss on the Lips', 'cherry juice', 2, 'apricot nectar', 7, 'serve over ice with straw')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Hot Gold', 'peach nectar', 3, 'orange juice', 6, 'pour hot orange juice in mug and add peach nectar')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Lone Tree', 'soda', 1.5, 'cherry juice', .75, 'stir with ice, strain into cocktail glass')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Greyhound', 'soda', 1.5, 'grapefruit juice', 5, 'stir over ice, stir well')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Indian Summer', 'apple juice', 2, 'hot tea', 6, 'add juice to mug and toff off with hot tea')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Bull Frog', 'iced tea', 1.5, 'lemonade', 5, 'stir over ice with lime slice')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Soda and It', 'soda', 2, 'grape juice', 1, 'shake in cocktail glass, no ice')
SELECT 1 FROM DUAL;
It worked but I have a few questions.
1. Is this the best way to Insert ALL? I mean can't I just name column names once and have it work for all rows IF I'm using all columns of the table? I tried but got errors, help me out here please?
2. Select 1 or * FROM DUAL - Why did it work when I selected 1 and not * from DUAL? Can you explain me the dual table please?
Trying to learn SQL - help is much appreciated, thanks.
Adi
Edited by: adi26 on Oct 22, 2012 3:17 PM