Subject Re: [IBO] Topic: KeyDescLinks with CalculatedFields bug?
Author Helen Borrie (TeamIBO)
At 07:08 PM 28-01-02 +0000, you wrote:
>Ibo 4.2Fp
>I've a detail query that sub-selects a procedure to display a lookup
>field. Everything worked fine until I defined a calculated field:
>PERSONALE_CHIARO CHAR(1).
>Even if the event handler qryMovConRigheCalculateField does nothing
>(the only line is 'exit'), when I post the record instead of the
>updated description I get the error:
>'EIB_StatementError: Fieldname SEL_CODICI_CONTABILI.OUT_PARTITA_ID not
>found'
>The record is correctly posted (SQL monitor shows that the insert has
>MOVCON_RIGHE.PARTITA value ok).
>So seems that the field calculation code is making the mess on the
>client side...
>Any idea?

It looks like a bird's nest, Marco.

>SELECT RIGA_CONTABILE_ID
> , MOVCON_ID
> , EDIFICIO_ID
> , SCALA_ID
> , PARTITA
> , PERSONALE
> , (SELECT OUT_DESCRIZIONEDISP
> FROM SEL_CODICI_CONTABILI(:CONDOMINIO_ID, :ESERCIZIO_ID)
> WHERE (OUT_PARTITA_ID = MOVCON_RIGHE.PARTITA))
> AS PT_DESCRIZIONE_CONTO
> , DARE
> , AVERE
> , DATA_SCADENZA
> , DESCRIZIONE
>FROM MOVCON_RIGHE

The error you describe may have more to do with the ambiguous sub-select. But because you are trying to do a correlated subselect from stored procedure output, I suspect you will continue to encounter positioning problems in the update, even after resolving the ambiguity.

I think it is a far stretch to expect KeyDescLinks to synchronise on a column that doesn't exist in a table. A possible solution worth trying would be to alter the SP so that it accepts OUT_PARTITA_ID as an input, but this is just a guess. I still don't see how the synchronisation could be done, when there only an output set to refer to.

Some other possible flaky areas:

- Do you have the column definitions in your CalculatedFields array?
e.g.
MYINTCOLUMN INTEGER NOT NULL
MYSTRCOLUMN VARCHAR ( 50 )
MYDATECOLUMN DATE

- Does your OnCalculateField event handler really do nothing except exit? If so, what do you expect IBO to do with it? If not, does it refer to the Row object, as it should?

- Did you set the COMPUTED attribute of the column being selected by the correlated sub-select?

>For reproducing the bug I think you can use the GSG example of
>KeyDescLinks and simply add a calculated field to the query.

In that case, it will be easy for you to prepare an example...


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com