Question: Debugging Question, correcting the below code CREATE TABLE tab1 (col1 CHAR(3), col2 CHAR(20)); COMMIT; INSERT INTO tab1 VALUES ('123', 'Red'); INSERT INTO tab1 VALUES ('456',
Debugging Question, correcting the below code CREATE TABLE tab1 (col1 CHAR(3), col2 CHAR(20)); COMMIT; INSERT INTO tab1 VALUES ('123', 'Red'); INSERT INTO tab1 VALUES ('456', 'Yellow'); SAVEPOINT s1 ON ROLLBACK RETAIN CURSORS; DELETE FROM tab1 WHERE col1 = '132'; INSERT INTO tab1 VALUES ('879', 'Blue'); ROLLBACK TO SAVEPOINT s1; INSERT INTO tab1 VALUES ('789', 'Green'); UPDATE tab1 SET col2 = PURPLE WHERE col1 = '789'; COMMIT; OUTPUT: COL1 COL2 123 Red 456 Yellow 789 PURPLE 3 record(s) selected
I get the following errors:
Msg 102, Level 15, State 1, Line 5 Incorrect syntax near 'SAVEPOINT'. Msg 102, Level 15, State 1, Line 5 Incorrect syntax near 'RETAIN'. Msg 156, Level 15, State 1, Line 8 Incorrect syntax near the keyword 'TO'. Msg 102, Level 15, State 1, Line 10 Incorrect syntax near ''. Msg 102, Level 15, State 1, Line 13 Incorrect syntax near 'COL1'.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
