PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → How to use a PostgreSQL sequence
How to use a PostgreSQL sequence
Iniciado por Henk OUWEJAN, 25,mar. 2016 14:12 - 1 respuesta
Miembro registrado
27 mensajes
Publicado el 25,marzo 2016 - 14:12
Hi all,

I'm new (very new) to win/webdev. I'm using PostgreSQL as database. As you know pgSQL use sequences for auto incremental keys. Can somebody explain to me how to use this in webdev.

The function is pgSQL = nextval('single_id_seq'::regclass)
Publicado el 28,marzo 2016 - 15:59
I use MS SQL Server, but the WebDev handling of the database should be consistent.

After the HAdd where you inserted your new record (without specifying the auto-increment column). You can simply retrieve the Database auto-assigned value by referring to it via the standard Table.Column syntax as the WebDev is now "sitting" on the newly inserted record.