Re: Validar parametros entrada

From: "Javier Aquino H(dot)" <JAquino(at)LexusEditores(dot)com>
To: "Jaime Casanova" <systemguards(at)gmail(dot)com>, "Mario Gonzalez" <gonzalemario(at)gmail(dot)com>
Cc: "Postgresql-es-ayuda" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Validar parametros entrada
Date: 2005-12-21 16:02:01
Message-ID: 009e01c60647$e133a260$0a010a0a@javier
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Holaaaa

----- Original Message -----
From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Mario Gonzalez" <gonzalemario(at)gmail(dot)com>
Cc: "Postgresql-es-ayuda" <pgsql-es-ayuda(at)postgresql(dot)org>
Sent: Wednesday, December 21, 2005 10:15 AM
Subject: Re: [pgsql-es-ayuda] Validar parametros entrada

>> IF nom_depto IS NULL AND nom_depto = \'\' THEN
>> o
>> IF nom_depto IS NULL AND length(nom_depto) = 0 THEN
>>
>
> es OR no AND
>
> IF nom_depto IS NULL OR length(nom_depto) = 0 THEN
>
> es muy temprano para mi todavia
>
> --
> Atentamente,
> Jaime Casanova
> (DBA: DataBase Aniquilator ;)
>

Además antes de hacer el INSERT puedes hacer un SELECT

SELECT Count(*)
INTO valor
WHERE nombre_departamento = nom_depto ;

Si "valor" es mayor a cero tons ya no haces el INSERT, de esa forma evitas
las claves duplicadas.

Saludos,

Javier.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Mario Gonzalez 2005-12-21 16:04:23 Re: Validar parametros entrada
Previous Message Mario Gonzalez 2005-12-21 15:34:38 Re: Validar parametros entrada