From: | "Jaime Casanova" <systemguards(at)gmail(dot)com> |
---|---|
To: | Arturo <arturomunive(at)gmail(dot)com> |
Cc: | Postgresql <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Herencia? |
Date: | 2007-05-06 13:16:41 |
Message-ID: | c2d9e70e0705060616m6a995171y66a2e55065731a7a@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
On 5/6/07, Arturo <arturomunive(at)gmail(dot)com> wrote:
> pero se me presenta un problema.
> quisiera declarar el campo id_venta como clave foranea a alguna tabla....
> pero no puedo hacer tal cosa por que
> esas id deben ser de facturas o boletas que son 2 tablas distintas
>
la tabla tabla a la que le vas a poner el FK debe teer in campo
tipo_venta (boleta o factura, quiza un campo char(1), un numerico
donde 1 sea boleta y 2 factura o en la version 8.3 que esta por salir
un tipo enumerado =)
luego creas un trigger que verifique que id_venta corresponde a una
boleta si tipo_venta = 1 o a una factura si tipo_venta = 2
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
From | Date | Subject | |
---|---|---|---|
Next Message | Arturo | 2007-05-06 21:12:56 | Re: Herencia? |
Previous Message | decastro | 2007-05-06 12:15:42 | Re: Conectarse desde Visual FoxPro usando ADO |