ABAP database operation series (7)

Source: Internet
Author: User

7. insert details:
insert into dbtab values wa.:
insert into (dbtabname) values wa.
insert dbtab from Wa.
insert (dbtabname) from Wa.
insert data in wa to the database. Insert a record each time. The fields in WA must be arranged in the same way as those in the database.
data: WA type scustom.
wa-id = '000000 '.
wa-name = 'robinson '.
wa-Postcode = '123 '.
wa-city = 'hiidelberg '.
wa-custtype = 'P '.
wa-discount = '003 '.
wa-telephone = '000000 '.
insert into scustom values wa.
insert dbtab from Table itab.
insert (dbtabname) from Table itab.
Insert the data in the itab table to the database, that is, insert multiple data records.
insert dbtab.: This statement is similar to the from Wa statement above. However, to declare this database table in the tables statement, dbtab is equivalent to a wa statement.

8. update details:
Update dbtab set F1... FN where cond.
Update (dbtabname) set F1... FN where cond.
update the database table based on the condition. F1... FN is the name of the field to be updated.
data: tabname type string,
set_clause type string.
tabname = 'scustom '.
set_clause = 'discount = ''003 '''.
Update (tabname) Set (set_clause ).
Update dbtab from Wa.
Update (dbtabname) from Wa.
update the database table based on the data in WA.
Update dbtab from Table itab.
Update (dbtabname) from Table itab.
update the database table based on the data in the internal table. Multiple records are updated.

9. modify details:
Modify dbtab from Wa.
Modify (dbtabname) from Wa.
Update/Insert a single piece of data to the database table. Determine whether to update or insert based on whether the primary key exists.
Modify dbtab from Table itab.
Modify (dbtabname) from Table itab.
Update/Insert multiple data entries to the database table. Determine whether to update or insert based on whether the primary key exists.

10. delete details:
Delete dbtab from Wa.
Delete (dbtabname) from Wa .,
Delete dbtab from Table itab.
Delete (dbtabname) from Table itab.
Delete one or more records.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.