Subject | Field became read only in the database? |
---|---|
Author | mmenaz |
Post date | 2002-02-13T20:24:36Z |
Hi, I've a program that worked ok until I rebuild the database (export metadata, run the metadata script).
After that a table has a key field that is "read only", in the sense that every value you put into it (and post+commit) get lost! No, there is not trigger before/after update in the table that can clear the field. I've inserted a row that have all fields with the right value except that one (that seems "empty", since it's not null and is blank).
Below the DDL of the table, the domain of the offending field (ESERCIZIO_ID) and whatever hope will help. This happens inside IBO and QuickDesk, so seems not to be a client problem :( (in QuickDesk I edit the record that has this field "empty" (it's not null, seems to be an empty string!), enter, for instance, '000000', then post. It's ok. Then Commit: the refresh shows a "empty" field again!)
Thanks
Marco Menadi
CREATE TABLE UNITA_U_CLIENTI (
ESERCIZIO_ID ESERCIZIOID_DM NOT NULL,
UICC_ID UICCID_DM NOT NULL,
CLIENTE_ID CLIENTEID_DM NOT NULL,
UNITAIMM_ID UNITAIMMID_DM NOT NULL,
TITOLO_RELAZIONE TITOLO_RELAZIONE_UIPE_DM,
DATA_INIZIO_LOCAZIONE DATA_CONTABILE_DM,
LEGAME_PRINCIPALE_ID UICCID_DM,
SOLLECITABILE SINO_DM,
SOLLECITO_LISTA_AZIONI VARCHAR (20),
PERC_QUOTA_PROPRIETA PERCENTUALE_DM DEFAULT 100,
PERC_QUOTA_CONDUZIONE PERCENTUALE_ZERO_DM,
CONDUZIONE_SPESE_DAL DATA_CONTABILE_DM,
CONDUZIONE_SPESE_AL DATA_CONTABILE_DM,
CONDUZIONE_ANNI_STEP SMINT_POS_DM,
DATAORA_MODIFICA DATAORA_MODIFICA_DM,
LOCK_FLG LOCK_FLG_DM NOT NULL);
/* Unique keys definition */
ALTER TABLE UNITA_U_CLIENTI ADD PRIMARY KEY (ESERCIZIO_ID, UICC_ID);
/* Foreign keys definition */
ALTER TABLE UNITA_U_CLIENTI ADD CONSTRAINT FK_CLIENTI_ID FOREIGN KEY (CLIENTE_ID) REFERENCES CLIENTI (CLIENTE_ID) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE UNITA_U_CLIENTI ADD CONSTRAINT FK_UNITAIMM_ID FOREIGN KEY (UNITAIMM_ID) REFERENCES UNITA_IMMOBILIARI (UNITAIMM_ID) ON DELETE CASCADE ON UPDATE CASCADE;
--------
CREATE DOMAIN ESERCIZIOID_DM AS
CHAR(6)
CHECK ((VALUE IS NULL) OR (VALUE = UPPER(VALUE)))
After that a table has a key field that is "read only", in the sense that every value you put into it (and post+commit) get lost! No, there is not trigger before/after update in the table that can clear the field. I've inserted a row that have all fields with the right value except that one (that seems "empty", since it's not null and is blank).
Below the DDL of the table, the domain of the offending field (ESERCIZIO_ID) and whatever hope will help. This happens inside IBO and QuickDesk, so seems not to be a client problem :( (in QuickDesk I edit the record that has this field "empty" (it's not null, seems to be an empty string!), enter, for instance, '000000', then post. It's ok. Then Commit: the refresh shows a "empty" field again!)
Thanks
Marco Menadi
CREATE TABLE UNITA_U_CLIENTI (
ESERCIZIO_ID ESERCIZIOID_DM NOT NULL,
UICC_ID UICCID_DM NOT NULL,
CLIENTE_ID CLIENTEID_DM NOT NULL,
UNITAIMM_ID UNITAIMMID_DM NOT NULL,
TITOLO_RELAZIONE TITOLO_RELAZIONE_UIPE_DM,
DATA_INIZIO_LOCAZIONE DATA_CONTABILE_DM,
LEGAME_PRINCIPALE_ID UICCID_DM,
SOLLECITABILE SINO_DM,
SOLLECITO_LISTA_AZIONI VARCHAR (20),
PERC_QUOTA_PROPRIETA PERCENTUALE_DM DEFAULT 100,
PERC_QUOTA_CONDUZIONE PERCENTUALE_ZERO_DM,
CONDUZIONE_SPESE_DAL DATA_CONTABILE_DM,
CONDUZIONE_SPESE_AL DATA_CONTABILE_DM,
CONDUZIONE_ANNI_STEP SMINT_POS_DM,
DATAORA_MODIFICA DATAORA_MODIFICA_DM,
LOCK_FLG LOCK_FLG_DM NOT NULL);
/* Unique keys definition */
ALTER TABLE UNITA_U_CLIENTI ADD PRIMARY KEY (ESERCIZIO_ID, UICC_ID);
/* Foreign keys definition */
ALTER TABLE UNITA_U_CLIENTI ADD CONSTRAINT FK_CLIENTI_ID FOREIGN KEY (CLIENTE_ID) REFERENCES CLIENTI (CLIENTE_ID) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE UNITA_U_CLIENTI ADD CONSTRAINT FK_UNITAIMM_ID FOREIGN KEY (UNITAIMM_ID) REFERENCES UNITA_IMMOBILIARI (UNITAIMM_ID) ON DELETE CASCADE ON UPDATE CASCADE;
--------
CREATE DOMAIN ESERCIZIOID_DM AS
CHAR(6)
CHECK ((VALUE IS NULL) OR (VALUE = UPPER(VALUE)))