Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting First Four records in a table

Status
Not open for further replies.

Sreevani

Programmer
Sep 14, 2000
4
US
Hi All,

I need to Delete First four Records in a table, am new to DB2, Can anyone help me on this??

Thanks,
 
Hello Sreevani,

There is really no such thing as "first x records" in a relational database like DB2. It may appear to be if you use a tool to look at the contents, but There is NO guarantee that the representation will be the exact state of the table. If you need to delete records from a table it should be based on precise conditions. If the table has a primary key, you can use this to state the delete action, otherwise use a combination of fields to get the proper conditions.
syntax is very simple:

delete from table
where ................... (the proper conditions)

Remember to give an additional commit or set to auto-commit to make a delete action permanent !!! T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top