Subject | [IBO] Re: Entering Litterals, Expressions directly into TIBOQuery Update SQL |
---|---|
Author | Tony Masefield |
Post date | 2006-06-23T23:06:37Z |
Thanks Helen,
As you put it it's a snap! Worked straight-off. Shouldn't have spent
so much time messing with IBX and MDO before opting for IBO which
has 'clouded' my vision somewhat (expecting them to be similar in
function).
Have to go back through the IBO manual again and 'relearn' the
concepts/features. Certainly much 'richer' than I expected.
Rgds,
As you put it it's a snap! Worked straight-off. Shouldn't have spent
so much time messing with IBX and MDO before opting for IBO which
has 'clouded' my vision somewhat (expecting them to be similar in
function).
Have to go back through the IBO manual again and 'relearn' the
concepts/features. Certainly much 'richer' than I expected.
Rgds,
> Not in the least - I totally agree with you. Tony is trying tobend
> and stretch his code to make IBO do what it does automatically.to
>
> You don't need the TIBOUpdateSQL *at all* - it's only there for
> compatibility when people are converting an old BDE
> application. TIBOQuery has the UpdateSQL properties embedded
> (EditSQL, InsertSQL and DeleteSQL). What's more, you don't have
> set them yourself unless you've got datasets that have to beupdate
> with specialised statements such as EXECUTE PROCEDURE calls.set
>
> For your master-detail setup, do the following basics:
>
> 1. Set up the master and its datasource first, e.g. qMaster and
> dsMaster, with SQL that is typically
>
> select mstrpkfield, fieldx, fieldy from mymaster
> where <some parameterised conditions)
>
> Set its KeyLinks property to mstrpkfield and set RequestLive true.
>
> If you are generating primary keys then set GeneratorLinks as:
> pkfield=mypkgeneratorname
>
> 2. Then set up the detail, e.g. QDetail and its datasource
> dsDetail. The SQL will be in one of two forms:
>
> a) if the fieldnames of the detail's foreign key and the master's
> primary key are the same then your query will be:
>
> select detlpkfield, mstrpkfield, fieldwhatever, .... from mydetail
>
> b) if the foreign key of the detail set and the PK of the master
> don't have matching names then the detail's SQL will bemydetail
>
> select detlpkfield, mstr_gulp_pkfield, fieldwhatever, ....from
> where mstr_gulp_pkfield = :mstr_gulp_pkfieldstatements
>
> Set the Keylinks to detlpkfield and set RequestLive true.
> Set the Datasource property to dsMaster.
>
> If you are generating primary keys then set GeneratorLinks as:
> detlpkfield=mydetlpkgeneratorname
>
>
> In both cases, by setting correct Keylinks and setting RequestLive
> true, you are telling IBO to generate the three UpdateSQL
> automatically.(situation
>
> If the detail's FK name and the master's PK name are same
> a) above) then you are done. Your master-detail interfacewill "just work".
> If the names are different then you have one more thing to do. Goto
> the AfterScroll event of the master set and add the following code:
>
> QDetail.ParamByName('mstr_gulp_pkfield').AsInteger :=
> Dataset.FieldByName('mstrpkfield').AsInteger;
>
> And now you are ready to roll.
>
> Helen
>