Using the DeleteSQL, InsertSQL, ModifySQL, and RefreshSQL Properties

From InterBase
Jump to: navigation, search

Go Up to Creating SQL Statements for Update Components


Use the DeleteSQL, InsertSQL, ModifySQL, and RefreshSQL properties to set the update SQL statements for each. These properties are all string list containers. Use the methods of string lists to enter SQL statement lines as items in these properties. Use an integer value as an index to reference a specific line within the property. The DeleteSQL, InsertSQL, ModifySQL, and RefreshSQL properties are accessible both at design time and at runtime.

with UpdateSQL1.DeleteSQL do begin
  Clear;
  Add(‘DELETE FROM Inventory I’);
  Add(‘WHERE (I.ItemNo = :OLD_ItemNo)’);
end;

Below, the third line of a SQL statement is altered using an index of 2 with the ModifySQL property.

UpdateSQL1.ModifySQL[2] := ‘WHERE ItemNo = :ItemNo’;

Advance To: