Ayuda Update Multiples Tablas

From: María Teresa Calbul T(dot) <mcalbul(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Ayuda Update Multiples Tablas
Date: 2005-03-20 06:01:03
Message-ID: 457bce8905031922011451093@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola, necesito hacer un update en el campo CUE_LOGIN para 2 tablas....

-->>Tabla cuenta:

cue_id | integer | not null default
nextval('public.cuenta_cue_id_seq'::text)
cue_login | character varying(8) | not null
cue_password | character varying(32) | not null
cue_fecha_creacion | date | not null
cue_fecha_caducidad | date | not null
cue_num_aleatorio | bigint | not null
usu_rut | character varying(11) | not null
Indexes: cuenta_pkey primary key btree (cue_login),
cuenta_usu_rut_key unique btree (usu_rut)
Foreign Key constraints: $1 FOREIGN KEY (usu_rut) REFERENCES
usuario(usu_rut) ON UPDATE NO ACTION ON DELETE NO ACTION

-->>Tabla permiso:

per_id | integer | not null default
nextval('public.permiso_per_id_seq'::text)
per_uid | integer | not null
per_gid | integer | not null
per_umask | character varying(4) | not null
per_quota | numeric | not null
per_descripcion | character varying(40) |
cue_login | character varying(8) | not null
Indexes: permiso_pkey primary key btree (per_id),
permiso_cue_login_key unique btree (cue_login)
Foreign Key constraints: $1 FOREIGN KEY (cue_login) REFERENCES
cuenta(cue_login) ON UPDATE NO ACTION ON DELETE NO ACTION

-------------------------
Al Hacer:

String sql2="UPDATE cuenta SET
CUE_LOGIN='"+Login+"',CUE_PASSWORD='"+Password+"',CUE_FECHA_CREACION='"+Fcreac+"',CUE_FECHA_CADUCIDAD='"+Fcaduc+"',CUE_NUM_ALEATORIO="+Aleatorio+"
WHERE USU_RUT='"+Rut2+"'";

El Error:

SQLException: ERROR: $1 referential integrity violation - key in
cuenta still referenced from permiso
Huvo un Problema, No se Pudo Actualizar!! con el Rut: 15234031-k
---------------------------

Si hago esto:
String sql3="UPDATE permiso SET CUE_LOGIN='"+Login+"' WHERE PER_UID="+Uid;

El Error:
SQLException: ERROR: $1 referential integrity violation - key
referenced from permiso not found in cuenta
Huvo un Problema, No se Pudo Actualizar!! con el Rut: 15234031-k
----------------------------

Gracias por la ayuda,

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2005-03-20 14:36:46 Re: Ayuda Update Multiples Tablas
Previous Message Edwin Quijada 2005-03-19 23:58:36 RE: BD v/s archivos