Dataset.Edit

Top  Previous  Next

 

Syntax

function Dataset.Edit(ADataset: pointer): boolean

 

Alternative Names

ibec_ds_Edit

 

Description

Sets the dataset ADataset in an 'edit state', in which you can modify its data using Dataset.SetField. You can then use Dataset.Cancel to revert to the original data, or Dataset.Post to modify the underlying table. In order to be able to edit row data, you need to have the primary key column(s) in the dataset SELECT clause.

 

See also

SELECT ... AS DATASET
Dataset.Append
Dataset.Cancel
Dataset.Delete
Dataset.Insert
Dataset.Post

 

Example

execute udsblock()

as

declare variable resultbool boolean;

begin

  /* create the data set */

  select employeeid, emp_name, salary, bonus_perc

  from test_data order by employeeid

  as dataset mydata;

  try 

    Dataset.Edit(mydata); /* put into edit mode */

    Dataset.SetFieldValue(mydata, 'emp_name', 'Harold');

    Dataset.Post(mydata);

    resultvarchar = Dataset.FieldValue(mydata, 'emp_name');

  finally

    Dataset.Close(mydata);

  end        

end