Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago