Subject RE: [IBO] IBOTable EditSQL not using primary key in 5.9.5
Author Jason Wharton
This is unexpected behavior.  Please at least provide the DDL for your tables, constraints, indexes, etc.
 
A sample app is alwyas greatly appreciated.
 
Thanks,
Jason Wharton
 


From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]
Sent: Thursday, September 28, 2017 6:52 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] IBOTable EditSQL not using primary key in 5.9.5

 

Hey Jason,

could you take a look into this? Do know if there is a way to fix this or need some test example to help you find the issue?

I need to upgrade to 5.9.5 so I can upgrade to Tokyo, but I can't until I fix this.

Thank you.


Em 21/09/2017 11:36, Guilherme Luiz Lanius speka@... [IBObjects] escreveu:
 

Hello,

I'm upgrading from 5.7.3 to 5.9.5 but I just found a problem with EDISQL
on IBOTable, it's not using the primary key when updating.

Primary Key is SAC_CF_LOJA, SAC_CF_DT_EMIS, SAC_CF_CONTROLE

5.7.3 SQL

UPDATE SAC_CF
  SET SAC_CF.SAC_CF_LOJA = ? /* SAC_CF.SAC_CF_LOJA */
    , SAC_CF.SAC_CF_DT_EMIS = ? /* SAC_CF.SAC_CF_DT_EMIS */
    , SAC_CF.SAC_CF_CONTROLE = ? /* SAC_CF.SAC_CF_CONTROLE */
    , SAC_CF.SAC_CF_NRO_CUPOM = ? /* SAC_CF.SAC_CF_NRO_CUPOM */
    , SAC_CF.SAC_CF_CAIXA = ? /* SAC_CF.SAC_CF_CAIXA */
WHERE SAC_CF.SAC_CF_LOJA = ? /* OLD.SAC_CF_LOJA */
  AND SAC_CF.SAC_CF_DT_EMIS = ? /* OLD.SAC_CF_DT_EMIS */
  AND SAC_CF.SAC_CF_CONTROLE = ? /* OLD.SAC_CF_CONTROLE */
PLAN (SAC_CF INDEX (SAC_CF_PRIMARY))

5.9.5 SQL

/* IBO System EditSQL with UpdateMode umAllWhereKey */
UPDATE SAC_CF
  SET SAC_CF.SAC_CF_LOJA = ?/* NEW.SAC_CF.SAC_CF_LOJA */
    , SAC_CF.SAC_CF_DT_EMIS = ?/* NEW.SAC_CF.SAC_CF_DT_EMIS */
    , SAC_CF.SAC_CF_CONTROLE = ?/* NEW.SAC_CF.SAC_CF_CONTROLE */
    , SAC_CF.SAC_CF_NRO_CUPOM = ?/* NEW.SAC_CF.SAC_CF_NRO_CUPOM */
    , SAC_CF.SAC_CF_CAIXA = ?/* NEW.SAC_CF.SAC_CF_CAIXA */
WHERE SAC_CF.SAC_CF_DT_EMIS = ?/* OLD.SAC_CF.SAC_CF_DT_EMIS */
  AND SAC_CF.SAC_CF_CONTROLE = ?/* OLD.SAC_CF.SAC_CF_CONTROLE */
RETURNING SAC_CF_LOJA
        , SAC_CF_DT_EMIS
        , SAC_CF_CONTROLE
        , SAC_CF_NRO_CUPOM
        , SAC_CF_CAIXA
PLAN (SAC_CF NATURAL)