Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete statement

Former Member
0 Kudos

HI Frds

How write a delete statement to delete entries from DB(Data Base).

Pls can one help me with this.

Thanks

By

Pari

8 REPLIES 8

prasanth_kasturi
Active Contributor
0 Kudos

hi,

DELETE dbtab

Syntax

DELETE { {FROM target [WHERE sql_cond]}

| {target FROM source} }.

Effect

The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.

System Fields

The statement DELETE sets the values of the system fields sy-subrc and sy-dbcnt.

sy-subrc Meaning

0 A least one row was deleted.

4 At least one row could not be deleted, since it was not found in the database table.

The statement DELETE sets sy-dbcnt to the number of deleted rows.

Note

The rows are deleted permanently from the database table in the next database commit. Until then, you can cancel the deletion using a database rollback. The statement DELETE sets a database lock until the next database commit or database rollback. If used incorrectly, this can lead to a deadlock.

The number of rows that can be deleted within a database LUW in the tables of a database has a specific restriction for each database, as each database system can only manage a limited amount of data in the rollback area, and a limited number of locks.

regards

prasanth

Former Member
0 Kudos

Hi,

You can use Delete from databasetable.

i.e. DELETE FROM dbase.

Edited by: Poonam Naik on May 30, 2008 12:50 PM

Former Member
0 Kudos

- DELETE FROM dbtab. or

DELETE FROM (dbtabname).

- DELETE dbtab FROM wa. or

DELETE (dbtabname) FROM wa.

- DELETE dbtab FROM TABLE itab. or

DELETE (dbtabname) FROM TABLE itab.

- DELETE dbtab. or

DELETE *dbtab.

- DELETE dbtab VERSION vers. or

DELETE *dbtab VERSION vers.

rwrd if helpful

Bhupal

Former Member
0 Kudos

use this

delete dbtabname where werks = '1000'.

regards,

venkat

Former Member
0 Kudos

Hi

There are several ways, these are the main ways:

DELETE FROM <DATABASE TABLE> WHERE <CONDITION>.

SELECT * FROM <DATABASE TABLE> WHERE <CONDITION>.
   DELETE <DATABASE TABLE>.
ENDSELECT.

Max

Former Member
0 Kudos

Hi,

PARAMETERS p_carrid TYPE sflight-carrid.

DELETE FROM sflight

WHERE carrid = p_carrid AND

fldate = sy-datum AND

seatsocc = 0.

2) DELETE sflight FROM TABLE sflight_key_tab.

Narasimha

Former Member
0 Kudos

DELETE <name dbtab> [where ..condition..]

Be careful it will delete the records can not rollback.

from

sujit

Former Member
0 Kudos

Hi

DELETE ( fieldname) from TABLENAME where <condition>.

hope it helps.

Reward if useful.

Regards

Megha Sharma