3. Statements : OpenROAD SQL Statements : Delete Statement : Examples—Delete Statement
 
Share this page                  
Examples—Delete Statement
Delete all rows in the personnel table containing the employee number (empno) displayed in the current frame, using the repeated option, then commit the changes:
repeated delete from personnel
          where personnel.empno = :empno;
commit;
Delete all rows in the personnel table:
delete from personnel;
Delete all rows in the table specified in the tablename field:
delete from :tablename;
Delete rows from a table, using variables in the statement to represent the table name and the where clause search condition:
whereclause = 'empno = 12';
tablename = 'personnel';
delete from :tablename where :whereclause;
Delete the row pointed to by the emp_cursor object:
delete from emp where current of emp_cursor;
if iirowcount = 0 then
message 'Delete failed';
endif;