Hello,
I'm having some problems with views.
Could please someone give me some help?
I created two tables and a view.
I created the view using WITH CASCADED CHECK OPTION
because I need to update some columns of the view.
When I do update 2007_marche set data_invio_teramo = current_date where
azienda='IT002RE005';
the db seems locked, apparently it does nothing, after a while I have to
interrupt using ^C to abort operation.
The table has only 30 rows.
here the commands to create tables and view:
create table master(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tipo_record char(1) not null default 'T',
id integer not null,
numero_record_dettaglio integer not null,
codice_azienda varchar(10),
id_fiscale varchar(16),
specie_allevata varchar(4),
denominazione_proprietario varchar(40),
id_fiscale_proprietario varchar(16),
denominazione_detentore varchar(40),
id_fiscale_detentore varchar(16),
ragione_sociale_fattura varchar(40),
codice_fiscale_fattura varchar(16),
indirizzo_fattura varchar(60),
localita_fattura varchar(49),
partita_iva_fattura varchar(11),
comune_fattura varchar(60),
cap_fattura varchar(5),
provincia_fattura varchar(2),
ragione_sociale_consegna varchar(40),
indirizzo_consegna varchar(60),
localita_consegna varchar(60),
comune_consegna varchar(60),
cap_consegna varchar(5),
provincia_consegna varchar(2),
tipo_pinza_imbolatore varchar(3),
numero_pinze_imbolatori varchar(2),
tipo_richiesta char(1),
tipo_ordine character(1) REFERENCES tipologia(tipo_articolo),
data_lotto date,
old_cod character varying(4),
destinatario varchar(4),
data_consegna_maior date,
data_fattura date DEFAULT '0000-00-00',
from_file integer REFERENCES files(id),
produttore character(3),
numero_fattura integer DEFAULT 0,
data_pagamento date,
data_accredito date,
importo_fattura decimal(10,3),
priorita integer DEFAULT 0,
data_ordine date default 0,
numero_ordine integer default 0,
importo_ordine decimal(10,3) default 0,
deposito_ordine integer default 0,
note varchar(100)
);
create table detail(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tipo_record char(1) not null default 'D',
id integer not null REFERENCES master(id),
codice varchar(14),
codice_elettronico varchar(16),
orecchio_ristampa character(1) DEFAULT '',
ns char(1),
progressivo_sostituzione char(1),
marca_sx char(1),
marca_dx char(1),
libro_genealogico char(1),
tipologia_marca varchar(3),
tipologia_transponder varchar(3),
gruppo_specie_transp varchar(2),
vettore varchar(50),
stato_spedizione varchar(30),
data_spedizione_maior date,
bolla integer,
colli integer,
data_invio_teramo date DEFAULT '0000-00-00'
);
create view 2007_marche AS select
master.id,
master.codice_azienda AS azienda,
master.id_fiscale,
master.specie_allevata,
master.denominazione_proprietario AS nome_proprietario,
master.id_fiscale_proprietario AS id_proprietario,
master.denominazione_detentore AS nome_detentore,
master.id_fiscale_detentore AS id_detentore,
master.ragione_sociale_fattura AS fatt_ragione_sociale,
master.codice_fiscale_fattura AS fatt_codice_fiscale,
master.indirizzo_fattura AS fatt_indirizzo,
master.localita_fattura AS fatt_localita,
master.partita_iva_fattura AS fatt_partita_iva,
master.comune_fattura AS fatt_comune,
master.cap_fattura AS fatt_cap,
master.provincia_fattura AS fatt_provincia,
master.ragione_sociale_consegna AS cons_ragione_sociale,
master.indirizzo_consegna AS cons_indirizzo,
master.localita_consegna AS cons_localita,
master.comune_consegna AS cons_comune,
master.cap_consegna AS cons_cap,
master.provincia_consegna AS cons_provincia,
master.tipo_pinza_imbolatore,
master.numero_pinze_imbolatori,
master.tipo_richiesta,
master.tipo_ordine,
master.data_lotto,
master.old_cod,
master.destinatario,
master.data_consegna_maior,
master.data_fattura,
master.from_file,
master.produttore,
master.numero_fattura,
master.data_pagamento,
master.data_accredito,
master.importo_fattura,
master.priorita,
master.data_ordine,
master.numero_ordine,
master.importo_ordine,
master.deposito_ordine,
master.note,
detail.codice AS marca,
detail.codice_elettronico,
detail.orecchio_ristampa,
detail.ns,
detail.progressivo_sostituzione AS progr_sostituzione,
detail.marca_sx,
detail.marca_dx,
detail.libro_genealogico,
detail.tipologia_marca AS tipologia,
detail.tipologia_transponder,
detail.gruppo_specie_transp,
detail.vettore,
detail.stato_spedizione,
detail.data_spedizione_maior,
detail.bolla,
detail.colli,
detail.data_invio_teramo
from master, detail where master.id=detail.id
and data_lotto between '2007-01-01' and '2007-12-31' WITH CASCADED CHECK
OPTION;
jo
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]