Subject Re: [IBO] TIBOQuery & n-tier updates
Author Helen Borrie
At 10:41 AM 14/06/2004 +0000, you wrote:

>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.

Is 'PAR2' the name of the primary key? If, let's say, the output fieldname
is 'FLD1'...then the DeleteSQL property should be:

EXECUTE PROCEDURE DEL_REC(:FLD1)

Then, the dataset will pass the value of the PK to the DeleteSQL at the
appropriate time and you don't have to worry about it.
The same goes for EditSQL and InsertSQL: use the Fieldnames of the dataset
for the corresponding parameterised pieces of your EXECUTE call.

>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.

The Params property contains the Params of the SELECT procedure, not the
DeleteSQL statement. Just correct the parameter name in the execute
statement and you'll find it will work fine.

Helen