Re: [SQL] auto_increment

2003-09-22 Thread Bruno Wolff III
On Mon, Sep 22, 2003 at 09:15:04 +0400, sad <[EMAIL PROTECTED]> wrote: > On Saturday 20 September 2003 10:23, you wrote: > > On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote: > > > How to Create auto_increment field in PostreSQL. > > > Can I create them using Trigger. > > > > Use the SERIAL

Re: [SQL] auto_increment

2003-09-21 Thread sad
On Saturday 20 September 2003 10:23, you wrote: > On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote: > > How to Create auto_increment field in PostreSQL. > > Can I create them using Trigger. > > Use the SERIAL datatype. See also the functions nextval(), currval() > and setval(). I believe it

Re: [SQL] auto_increment

2003-09-20 Thread btober
> How to Create auto_increment field in PostreSQL. Its called the SERIAL datatype: create table test_table ( field1 serial, constraint test_table_pkey primary key (field1)); > Can I create them using Trigger. Yes, alternatively, but I'm told that is not recommended because the server source c

Re: [SQL] auto_increment

2003-09-20 Thread Christopher Browne
In the last exciting episode, [EMAIL PROTECTED] ("Muhyiddin A.M Hayat") wrote: > Ok, but if i do rollback, the auto_increment don't roolback. Right, it's not supposed to. Think about the situation where you have 5 clients connecting to the database and adding records to this table. The current f

Re: [SQL] auto_increment

2003-09-20 Thread Richard Huxton
On Saturday 20 September 2003 11:14, Muhyiddin A.M Hayat wrote: > Where/How can i put this below sql statement, to set value of > guest_guest_id_seq before i do insert to table > SELECT setval('guest_guest_id_seq', max(guest.guest_id)) FROM guest; > > i have been try > > CREATE TRIGGER "before_in

Re: [SQL] auto_increment

2003-09-20 Thread Martin Marques
o: 'Muhyiddin A.M Hayat' > Sent: Saturday, September 20, 2003 2:15 PM > Subject: RE: [SQL] auto_increment > > > Create table tablename( > > id serial, > > > > ); -- Porqué usar

Re: [SQL] auto_increment

2003-09-20 Thread Martin Marques
El Sáb 20 Sep 2003 03:23, Oliver Elphick escribió: > On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote: > > How to Create auto_increment field in PostreSQL. > > Can I create them using Trigger. > > Use the SERIAL datatype. See also the functions nextval(), currval() > and setval(). Also to a

Re: [SQL] auto_increment

2003-09-20 Thread Muhyiddin A.M Hayat
;public"."guest" FOR EACH ROW EXECUTE PROCEDURE "public"."generate_guest_id"(); but error - Original Message - From: "Richard Huxton" <[EMAIL PROTECTED]> To: "Muhyiddin A.M Hayat" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED

Re: [SQL] auto_increment

2003-09-20 Thread Richard Huxton
On Saturday 20 September 2003 09:43, Muhyiddin A.M Hayat wrote: > Ok, but if i do rollback, the auto_increment don't roolback. It's not supposed to. > How to use nextval(), currval() and setval() functions. Something like: INSERT INTO my_table(nextval('my_sequence_name'),'aaa',1); But you'll g

Re: [SQL] auto_increment

2003-09-20 Thread Muhyiddin A.M Hayat
Ok, but if i do rollback, the auto_increment don't roolback. How to use nextval(), currval() and setval() functions.   - Original Message - From: Cavit Keskin To: 'Muhyiddin A.M Hayat' Sent: Saturday, September 20, 2003 2:15 PM Subject: RE: [SQL]

Re: [SQL] auto_increment

2003-09-19 Thread Oliver Elphick
On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote: > How to Create auto_increment field in PostreSQL. > Can I create them using Trigger. Use the SERIAL datatype. See also the functions nextval(), currval() and setval(). -- Oliver Elphick[EMAIL PROTECTED] Isl

[SQL] auto_increment

2003-09-19 Thread Muhyiddin A.M Hayat
How to Create auto_increment field in PostreSQL. Can I create them using Trigger.