Deleting Rows from the Database


You use the SQL DELETE statement to delete existing rows from a table. You can use the executeUpdate() method defined in the Statement class or the execute() method defined in the PreparedStatement class.

The following example illustrates how to delete customer #5 from the customers table:

 myStatement.executeUpdate("DELETE FROM customers " +  "WHERE customer_id = 5"); 

Once this statement has completed, the row for customer #5 will have been removed from the customers table.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net