Subject Re: [IBO] How To InsertSQL, EditSQL & DeleteSQL
Author Helen Borrie
At 08:49 AM 01-06-01 +0000, you wrote:
>I have a Midas app, using IBO_Queries on the middle tier.
>On the client I am using a 1st class DBTreeview to navigate through
>the data.
>I have a Customer table and a premises table, joined by refno.
>Now, what I want to do is to be able to join the 2 tables with my
>IBOQuery, so that the users can 'toggle' between navigating by
>Customer.Surname and Premises.Postcode.
>My problems start with actually alterring the data.
>The way I understand it, I can use EditSQL etc to do this.
>I have generated the actual SQL and I believe I can assign all the
>parameters in the "BeforeUpdateRecord" event of my datasetprovider
>and then set Applied to True.
>However, I don't know how to actually execute the EditSQL etc. I
>mean, I can't just go ExecSQL - how does it know if it is deleting or
>editting etc?
>So basically I want to know how to do it and if what I am planning
>will work, below is how I think it should be done - ???? denote not
>In the Before Update record of the DSP
>if UpdateKind = ukInsert then
> parambyname('AAA').AsString := DeltaDS.FieldByName('AAA').NewValue;

No, you don't call the Execute method yourself, the dataset does it for you. Basically, the InsertSQL is posted when you call Post from Insert mode; EditSQL when posting from Edit mode; and DeleteSQL when posting from Delete mode. (All data access components execute DML when they post; you only "know" about it if you need to define special DML statements via these "UpdateSQL" properties...)


All for Open and Open for All
InterBase Developer Initiative ยท