RE: EJEMPLO DE RETURNING

From: Henry <hensa22(at)yahoo(dot)es>
To: MIGUEL CANCHAS <mcanchas(at)tsr(dot)com(dot)pe>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: RE: EJEMPLO DE RETURNING
Date: 2007-11-16 21:58:09
Message-ID: 934507.18580.qm@web30810.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


--- MIGUEL CANCHAS <mcanchas(at)tsr(dot)com(dot)pe> escribió:

> Este es el ejemplo
> INSERT INTO distributors (did, dname) VALUES
> (DEFAULT, 'XYZ Widgets')
> RETURNING did;
>
> Y lo saco asi pero me da error
> INSERT INTO ACCESOS_USUARIOS(IDUSUARIO, NOMUSUARIO,
> CLAVUSUARIO)VALUES(DEFAULT, 'MIGUEL','101010')
> RETURNING IDUSUARIO;
>
> ERROR: syntax error at or near "RETURNING" at
> character 100
>
> Si lo ejecuto sin el RETURNING IDUSUARIO graba bien
> A que se debe mi error ?

parece que estas con version de postgresql que no
soporta returning.

muy aparte de eso,
debes de asignarle a alguna variable el valor
retornado por returning

INSERT INTO ACCESOS_USUARIOS(IDUSUARIO, NOMUSUARIO,
CLAVUSUARIO)VALUES(DEFAULT, 'MIGUEL','101010')
RETURNING IDUSUARIO into algunavariable;

y si quieres todo el registro.
...........RETURNING * into algunRecord;

saludos.


______________________________________________
Pregunta, Responde, Descubre.
Comparte tus consejos y opiniones con los usuarios de Yahoo! Respuestas
http://es.answers.yahoo.com/info/welcome

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2007-11-16 22:01:06 Re: EJEMPLO DE RETURNING
Previous Message Javier Chavez Barra 2007-11-16 21:21:42 Re: POSTGRESQL TRANSACCIONAL