3. Statements : OpenROAD SQL Statements : Update Statement : Examples—Update Statement
 
Share this page                  
Examples—Update Statement
Update rows in the projects table with values from the current frame:
repeated update projects
     set hours = :hours, duedate = :enddate
     where name = :name;
commit;
Update the personnel table with a computed value:
update personnel
     set sal = :salary * 1.1
     where empno = :empno;
commit;
Update the salaries of all employees in job category, acc, using the value for a standard raise in the table dept:
update employee e from dept d
     set salary = d.std_raise * e.salary
     where e.jobcat = 'acc' and d.dname = e.dname;
commit;
Update the vendor address based on the attributes of the addr reference variable:
update vendor
     set city = :addr.city, state = :addr.state
     where vendorno = :vno;
commit;
Update the row pointed to by the open cursor, emp_cursor:
update emptable
     set name = :namefield, age = :agefield
     where current of emp_cursor;
commit;