Subject Re: [IBO] TIBOQuery & n-tier updates
Author constantijnw
> No, not at all. The IBODataset does that itself and it uses
> ExecuteImmediate. In the normal course of events, the IBODataset
creates
> the UpdateSQL statements itself, using the KeyLinks to build the
WHERE
> clause and populate the XSQLDAs.
>
> You only need to configure the property explicitly where you have to
call
> custom SQL to perform the operation - as is perhaps your situation
here -
> it's necessary for joined sets that need more than one table
updated, for
> example. If you only want one table from a joined set to be
updated, you
> can use the KeyRelation property to tell IBO which table, and you
won't
> need custom SQL unless you have something special to do.
>
> Just put your parameterised UpdateSQL in the relevant property
(EditSQL,
> InsertSQL, DeleteSQL) of the provider. Make sure you have the
correct
> KeyLinks set. You'll save some code if the parameter names match
the
> KeyLinks names. If the names are mismatched, or you want to
intervene in
> some special way, e.g. to do some kind of validation, you'll have to
assign
> the parameter values yourself in the Before event.
>
> >In that case I'm interested to learn
> >how to implement the AParam parameter of type PXSQLDA of the
> >ExecuteImmediate method (recommended by Jason in message 25390).
>
> This is necessary only if you have to call ExecuteImmediate in your
own
> code. If you have a dog, you don't need to bark yourself...
>
> The API Guide explains usage and data and where the XSQLDA
structures fit
> into the big picture. Probably the only way you're going to get
hold of
> this is to track through the code to see the declarations and how
the code
> instantiates, populates and uses an XSQLDA record. Start in
IB_Header.pas
> and work through IB_Components.pas.
>
> If you decide to walk this rarefied path, a Howto article would be
warmly
> accepted. :-)
>
> Helen

Hi Heleen,

I use sp's for IBOQuery selects and updates:

Select:
SELECT FLD1, FLD2, .. FROM SEL_RECS(:PAR1);
PAR1 is included in the Params property and works just fine.
PAR1 doesn't equal any fieldname (it's a where conditions string).

Delete:
EXECUTE PROCEDURE DEL_REC(:PAR2);
PAR2 is the PK which is also included in the selected fieldlist.

Whatever I try, PAR2 isn't assigned the proper value (remains NULL).
I've included PAR2 in the Params property. I've assigned PAR2 a value
in the BeforeDelete event handler. In the monitor I see that DEL_REC
is executed, but the BeforeDelete event is not fired.