0% found this document useful (0 votes)
20 views

Update From

The UPDATE statement is used to update values in database tables. It requires populating a work area with the new values for the specified key and then using the UPDATE statement to update the values in the database table. The syntax includes specifying the database table and work area. A WHERE clause can be used to only update rows that meet certain conditions, otherwise all rows will be updated.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Update From

The UPDATE statement is used to update values in database tables. It requires populating a work area with the new values for the specified key and then using the UPDATE statement to update the values in the database table. The syntax includes specifying the database table and work area. A WHERE clause can be used to only update rows that meet certain conditions, otherwise all rows will be updated.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

UPDATE is the open SQL statement to change the values in the database table.

First declare a work area as the line structure of database table and populate the work area with the desired values for a specific key in the database table. Then update the values for the specified key in the database table using UPDATE statement. The syntax for the UPDATE statement is as follows. UPDATE <database table> FROM <work area> If the database table contains a line with the same primary key as specified in the work area, the operation is completed successfully and SY-SUBRC is set to 0. Otherwise, the line is not inserted, and SY-SUBRC is set to 4.
DATA: gwa_employee TYPE zemployee. gwa_employee-id gwa_employee-name gwa_employee-place gwa_employee-phone gwa_employee-dept_id = = = = = 6. 'JOSEPH'. 'FRANKFURT'. '7897897890'. 5.

UPDATE zemployee FROM gwa_employee.

EMPLOYEE table entries before UPDATE

EMPLOYEE table entries after UPDATE

We can also change certain columns in the database table using the following syntax UPDATE <target> SET <set1> <set 2> [WHERE <condition>]. The WHERE clause determines the lines that are changed. If we do not specify a WHERE clause, all lines will be changed.
UPDATE zemployee SET place = 'MUMBAI' WHERE dept_id = 2.

EMPLOYEE table entries after UPDATE

You might also like