Previous Topic Next topic Print topic


TO DELETE USE

Specifies, for a specific DataTable, the SQL logic necessary to make deletes from a data source.

Syntax:

>>--EXEC ADO-.--------------------.-TO DELETE-.------.-datatable_name-->
             +-USING dataset_name-+           +-FROM-+ 

 >--------------USE--+-sql_searched_delete_statement-+----------------->
                     +-stored_procedure_statement----+                          
  
 >--END-EXEC---><

Parameters:

datatable_name The name of a DataTable.
dataset_name The DataSet reference to be used. If you do not specify dataset_name, the current DataSet is used.
sql_searched_delete_statement A standard SQL DELETE (SEARCHED) statement that references a table in a data source.
stored_procedure_statement Specifies which stored procedure to execute.

Comments:

The SQL logic must reference actual tables and columns in the data source.

The SQL logic can refer to column values for the row that has been deleted in the DataTable by using the column name enclosed in braces, optionally followed by the type of value (CURRENT, ORIGINAL, DEFAULT, or PROPOSED), separated by a period. For example, {OrderId} or {OrderID.Original}.

Example:

     EXEC ADO PREPARE TO UPDATE Orders, Customers, "Order Details" END-EXEC
        EXEC ADO TO DELETE FROM Customers USE
           DELETE FROM Customers WHERE CustomerID = {CustomerID}
        END-EXEC
     EXEC ADO UPDATE DATASOURCE END-EXEC
Previous Topic Next topic Print topic