05-30-2008 11:46 AM
HI Frds
How write a delete statement to delete entries from DB(Data Base).
Pls can one help me with this.
Thanks
By
Pari
05-30-2008 11:47 AM
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
05-30-2008 11:47 AM
Hi,
You can use Delete from databasetable.
i.e. DELETE FROM dbase.
Edited by: Poonam Naik on May 30, 2008 12:50 PM
05-30-2008 11:48 AM
- 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
05-30-2008 11:48 AM
05-30-2008 11:49 AM
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
05-30-2008 11:49 AM
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
05-30-2008 11:52 AM
DELETE <name dbtab> [where ..condition..]
Be careful it will delete the records can not rollback.
from
sujit
05-30-2008 12:17 PM
Hi
DELETE ( fieldname) from TABLENAME where <condition>.
hope it helps.
Reward if useful.
Regards
Megha Sharma