Home | Previous Page | Next Page   Purpose-Function Reference > Purpose-Function Flow >

INSERT, DELETE, and UPDATE Statement Interface

Figure 24 shows the order in which the database server executes purpose functions to insert, delete, or update a row at a specific physical address. The physical address consists of fragment identifier and row identifier.

Figure 24. INSERT, DELETE, or UPDATE by Row Address
Flowchart sh ows a m_open fragment pointing to a box which contains am_insert row, am_delete row, or am_update row. This box points to am_close fragment.

Figure 25 shows the order in which the database server executes purpose functions if the insert, delete, or in-place update has an associated WHERE clause.

Figure 25. INSERT, DELETE, or UPDATE in a Subquery
Flowchart shows am_scancost pointing to am_open, which points to am_beginscan, which points to am_getnext. If the am_getnext returns MI_ROWS, the scan executes am_delete or am_update, and then executes am_getnext again. If am_getnext returns MI_NO_MORE_RESULTS, the scan continues to am_endscan, which points to am_close.

Figure 26 shows the more complicated case in which am_getnext returns multiple rows to the database server. In either case, the database server calls am_insert, am_delete, or am_update once per row.

Figure 26. Returning Multiple Rows That Qualify for INSERT, DELETE, or UPDATE
Flowchart shows am_scancost pointing to am_open, which points to am_beginscan, which points to am_getnext. If the am_getnext returns MI_ROWS, the diagram points to a box that contains am_insert, am_delete, or am_update. This box points to another box that contains nextrow = norows? If Yes, the scan returns to am_getnext. If No, the scan returns to the box that contains am_insert, am_delete, or am_update. If am_getnext returns MI_NO_MORE_RESULTS, the scan continues to am_endscan, which points to am_close.

For more information about implementing insert, delete, and update statements, refer to Supporting Data Retrieval, Manipulation, and Return.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]