Re: regresar el valor de un serial

From: Rubén Luna <rpgsql(at)gmail(dot)com>
To: Roberto Aguirre <raguirre(at)infonegocio(dot)net(dot)pe>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: regresar el valor de un serial
Date: 2006-01-04 12:11:17
Message-ID: b7276af60601040411w59f11439sa2e3a319d7e8577d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

AHI ESTA MAS ORDENADO :-)

> CREATE OR REPLACE FUNCTION sgct.fp_cliente_contacto_ins("numeric",
> "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", date)
> RETURNS int8 AS
> $BODY$
>
> DECLARE
> id int8;
> BEGIN
>
> INSERT INTO sgct.cliente_contacto
> (
> codigo_cliente,
> usuario,
> programa,
> factual,
> nombre_contacto,
> nombre_cargo,
> telefono,
> email,
> fecha_cumpleanio
> )
> VALUES
> ($1, $2, $3,CURRENT_TIMESTAMP, $4, $5, $6, $7, to_date($8,'yyyy-mm-dd'));
>
>
> id=currval('sgct.cliente_contacto_codigo_contacto_seq');
> return id;
>
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
> ALTER FUNCTION sgct.fp_cliente_contacto_ins("numeric", "varchar",
> "varchar",
> "varchar", "varchar", "varchar", "varchar", date) OWNER TO postgres;
> YO TRABAJO CON plpgsql , espero te sirva.
> Atte
> Rubén Luna
>
>

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Mario Gonzalez 2006-01-04 12:35:51 PostgreSQL, SSL y psycopg
Previous Message Rubén Luna 2006-01-04 12:06:19 Re: regresar el valor de un serial