create table autoincrement

Started by Jose Manuel Lorenzo Lopezover 24 years ago3 messagesgeneral
Jump to latest
#1Jose Manuel Lorenzo Lopez
jose-manuel.lorenzo-lopez@ica.conti.de

Hello PG's,

is it possible to create a table with key fields (integer) that will autoincrement
when inserting a dataset???

Thanks for your help in advance!

Best Regards / Un saludo / Mit freundlichen Gr��en

Jos� Manuel Lorenzo L�pez

**********************************************************************
** Jos� Manuel Lorenzo L�pez **
** **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH **
** Dept. SAP Basis R/3 VBue **
** **
** e-mail to: jose-manuel.lorenzo-lopez@ica.conti.de **
**********************************************************************

#2Brent R. Matzelle
bmatzelle@yahoo.com
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: create table autoincrement
--- Jose Manuel Lorenzo Lopez
<jose-manuel.lorenzo-lopez@ica.conti.de> wrote:

Hello PG's,

is it possible to create a table with key fields (integer)
that will autoincrement
when inserting a dataset???

Thanks for your help in advance!

Try the SERIAL data type.

Brent

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

#3Richard Huxton
dev@archonet.com
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: create table autoincrement

From: "Jose Manuel Lorenzo Lopez" <jose-manuel.lorenzo-lopez@ica.conti.de>

Hello PG's,

is it possible to create a table with key fields (integer) that will

autoincrement

when inserting a dataset???

Look in the manuals for the CREATE SEQUENCE stuff. There is a special type
SERIAL which does all this for you. Check Bruce's online book too - bound to
have examples in that.

- Richard Huxton