Re: Insert Question

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Insert Question
Date: 2006-11-02 20:18:28
Message-ID: 20061102201828.GA8502@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

am Thu, dem 02.11.2006, um 12:01:51 -0800 mailte operationsengineer1(at)yahoo(dot)com folgendes:
> hhi all,
>
> long time no askie question, but here goes...
>
> i want to insert sequential document numbers into a
> products table
>
> my current setup is like so:
>
> product_number document_number
> 1001
> 1002
> 1006
> 1005
>
> i want an insert statement that will yield the
> following:
>
> product_number document_number
> 1001 42000001
> 1002 42000002
> 1006 42000003
> 1005 42000004

Create a sequence that starts with 42000001, and insert
nextval('this_sequence') for this column. (document_number).

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Broersma Jr 2006-11-02 20:21:27 Re: Insert Question
Previous Message Davis, Sean (NIH/NCI) [E] 2006-11-02 20:16:04 Re: Insert Question