Discussion:
How to use ModifySQL in IBDataSet
(too old to reply)
pcerdaz
2007-01-16 11:00:54 UTC
Permalink
Hello,

I don't understand how can I use ModifySQL. There is a way to define the SQL sentence on desing time but after that, on runtime I need to make an update passing parameters, the same ones that use the insert sentence, so how can I made the difference between those two sentence? Is there some guide to learn? The help does not explain this matter.

Thank you,
pcerdaz
Wayne Niddery [TeamB]
2007-01-16 18:21:47 UTC
Permalink
Post by pcerdaz
I don't understand how can I use ModifySQL. There is a way to define
the SQL sentence on desing time but after that, on runtime I need to
make an update passing parameters, the same ones that use the insert
sentence, so how can I made the difference between those two
sentence? Is there some guide to learn? The help does not explain
this matter.
You never use the Modify (or other) SQL statements directly, IBDataset uses
them in response to you calling Edit or Insert or Delete. Just assign the
field values you know are needed to be set and IBDataset will take care of
assigning parameters for the statement it is executing. You only need to set
parameters for any you have specified in the Select statement.

E.g.

IBDataset.Edit;
IBDataset.FieldByName('Name').AsString := 'Wayne';
IBDataset.FieldByName('Salary').AsFloat := '1000000';
IBDataset.Post;

On calling Post, the IBDataset will assign the corresponding parameters for
the Update SQL and execute it.
--
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"The two most abundant elements in the universe are hydrogen and
stupidity." - Harlan Ellison
Loading...