SQLMemTable: BDE Alternative Embedded
In-Memory Database with SQL for Delphi / C++Builder


RestructureTable Example
Top 


SQLMemTable1.Active := true;
with SQLMemTable1 do
begin
{modify fields structure}
with RestructureFieldDefs do
begin
// add new field
Add('Customer Name',ftString,300,False);
// rename 'id' field
Find('id').Name := 'Customer ID';
// set new length for Company field
Find('Company').Size := 100;
// delete 'Birthday' field
Delete(Find('Birthday').Index);
end;
{modify index definitions}
with RestructureIndexDefs do
begin
// add new index for Customer Name field
Add('CustomerName_Index','Customer Name',[ixCaseInsensitive]);
// rename primary index
Find('id_index').Fields := 'Customer ID';
Find('id_index').Name := 'CustomerID_index';
end;
{change fields structure}
RestructureTable;
end;



© AidAim Software SQLMemTable: