Re: Serial

From: Sebastián Villalba <sebastian(at)fcm(dot)unc(dot)edu(dot)ar>
To: "guillermo saez" <gsaez78(at)hotmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Serial
Date: 2005-10-25 02:29:30
Message-ID: 20051025022645.M95385@fcm.unc.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola Guillermo...

On Mon, 24 Oct 2005 15:51:21 -0700, guillermo saez wrote
> hola, mi pregunta es la siguiente,tengo una tabla el y el codigo
> principal es autonumerico osea de tipo serial, mi consulta es ¿como
> yo puedo rescatar ese codigo al momento de guardar un registro en la
> base de datos desde mi programa?

La función que necesitas es currval().

http://www.postgresql.org/docs/8.0/static/functions-sequence.html

Saludos...
-
-------------------------------------------
Sebastián Villalba
sebastian(at)fcm(dot)unc(dot)edu(dot)ar
-------------------------------------------

In response to

  • Serial at 2005-10-24 22:51:21 from guillermo saez

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Sebastián Villalba 2005-10-25 02:42:55 Re: Ayuda
Previous Message guillermo saez 2005-10-24 22:51:21 Serial