Re: [SQL] SQL INSERT/TRIGGER Help

2007-12-10 Thread Alvaro Herrera
Poovendran Moodley escribió: > I'm not really sure how to the *currval() *method. I've read up on it and I > noticed it works with *nextval()* and *setval()*. The parameter for * > currval()* is a regex - is there a regex to represent the most recently > automatically generated number ( i.e. a seri

Re: [SQL] SQL INSERT/TRIGGER Help

2007-12-10 Thread Poovendran Moodley
Aww man thank you so much! It worked like a charm! Have a smashing day :D On Dec 10, 2007 9:43 AM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Mon, dem 10.12.2007, um 9:27:58 +0200 mailte Poovendran Moodley > folgendes: > > I'm not really sure how to the currval() method. I've read up on it a

Re: [SQL] SQL INSERT/TRIGGER Help

2007-12-09 Thread A. Kretschmer
am Mon, dem 10.12.2007, um 9:27:58 +0200 mailte Poovendran Moodley folgendes: > I'm not really sure how to the currval() method. I've read up on it and I > noticed it works with nextval() and setval(). The parameter for currval() is a > regex - is there a regex to represent the most recently auto

Re: [SQL] SQL INSERT/TRIGGER Help

2007-12-09 Thread Poovendran Moodley
I'm not really sure how to the *currval() *method. I've read up on it and I noticed it works with *nextval()* and *setval()*. The parameter for * currval()* is a regex - is there a regex to represent the most recently automatically generated number ( i.e. a serial field)? If there isn't, I was thin

Re: [SQL] SQL INSERT/TRIGGER Help

2007-12-09 Thread A. Kretschmer
am Mon, dem 10.12.2007, um 8:36:44 +0200 mailte Poovendran Moodley folgendes: > So obviously I need to insert into the table Observation_Value first before I > can insert into table Observation, but how to I get the automatically > generated > foreign key? You can simple use currval() for this.

[SQL] SQL INSERT/TRIGGER Help

2007-12-09 Thread Poovendran Moodley
Hi all, I'm not sure how to phrase this question... I have a table that requires a foreign key of another table - this foreign key is automatically generated and the key field in the 'foreign' table. So I have the following situation (kind of): Table *Observation* *Time_Stamp* - *primary key* ..