pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedlast value
5+ messages / 5 participants
[nested] [flat]
* last value
@ 2005-05-04 12:18 Roni Warken <rwarken@gmail.com>
2005-05-04 13:09 ` Re: last value Pawel Bernat <asm@vlo.olsztyn.pl>
2005-05-04 13:19 ` Re: last value Thom Dyson <TDyson@sybex.com>
0 siblings, 2 replies; 5+ messages in thread
From: Roni Warken @ 2005-05-04 12:18 UTC (permalink / raw)
To: pgsql-php
I tried to search some thread that could help me, but didn't find
anything (maybe because I didn't know how to search).
I have a script that insert some values in a table. After this, I have
to take the value of the primary key just inserted, and insert it in
another table, all in the same script.
How can I do that? Or if you have a better idea of how to get the last
value and insert in the other table, please tell me.
Thanks.
--
Roni Warken
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: last value
2005-05-04 12:18 last value Roni Warken <rwarken@gmail.com>
@ 2005-05-04 13:09 ` Pawel Bernat <asm@vlo.olsztyn.pl>
1 sibling, 0 replies; 5+ messages in thread
From: Pawel Bernat @ 2005-05-04 13:09 UTC (permalink / raw)
To: pgsql-php
On Wed, May 04, 2005 at 09:18:12AM -0300, Roni Warken wrote:
> How can I do that? Or if you have a better idea of how to get the last
> value and insert in the other table, please tell me.
CURRVAL()
p.
--
Paweł Bernat; uselessness' lover;
select'<asm'||chr(64)||'asm'||'.'||'flynet'||chr(46)||'pl>'as email;
Slowly and surely the unix crept up on the Nintendo user ...
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: last value
2005-05-04 12:18 last value Roni Warken <rwarken@gmail.com>
@ 2005-05-04 13:19 ` Thom Dyson <TDyson@sybex.com>
1 sibling, 0 replies; 5+ messages in thread
From: Thom Dyson @ 2005-05-04 13:19 UTC (permalink / raw)
To: Roni Warken <rwarken@gmail.com>; +Cc: pgsql-php
Since this is a data integrity question (I presume) as much as an
application question, you could put a trigger on the 1st table that says,
"when a new record is added, seed data in other tables". I have it at
work. If you need more info, let me know.
Thom Dyson
Director of Information Services
Sybex, Inc.
pgsql-php-owner@postgresql.org wrote on 05/04/2005 09:18:12 AM:
> I tried to search some thread that could help me, but didn't find
> anything (maybe because I didn't know how to search).
> I have a script that insert some values in a table. After this, I have
> to take the value of the primary key just inserted, and insert it in
> another table, all in the same script.
> How can I do that? Or if you have a better idea of how to get the last
> value and insert in the other table, please tell me.
> Thanks.
> --
> Roni Warken
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: last value
@ 2005-05-04 13:19 moalaniz@unsl.edu.ar
0 siblings, 0 replies; 5+ messages in thread
From: moalaniz@unsl.edu.ar @ 2005-05-04 13:19 UTC (permalink / raw)
To: rwarken@gmail.com; TDyson@sybex.com; +Cc: pgsql-php
unsubscribe
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: last value
@ 2005-05-05 04:37 Ramakrishnan Muralidharan <ramakrishnanm@pervasive-postgres.com>
0 siblings, 0 replies; 5+ messages in thread
From: Ramakrishnan Muralidharan @ 2005-05-05 04:37 UTC (permalink / raw)
To: Roni Warken <rwarken@gmail.com>; pgsql-php
Hi,
Create a Trigger for the first table for updating the primary key of the fist table into second table
Regards,
R.Muralidharan
-----Original Message-----
From: pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]On Behalf Of Roni Warken
Sent: Wednesday, May 04, 2005 5:48 PM
To: pgsql-php@postgresql.org
Subject: [PHP] last value
I tried to search some thread that could help me, but didn't find
anything (maybe because I didn't know how to search).
I have a script that insert some values in a table. After this, I have
to take the value of the primary key just inserted, and insert it in
another table, all in the same script.
How can I do that? Or if you have a better idea of how to get the last
value and insert in the other table, please tell me.
Thanks.
--
Roni Warken
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-05-05 04:37 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-04 12:18 last value Roni Warken <rwarken@gmail.com>
2005-05-04 13:09 ` Pawel Bernat <asm@vlo.olsztyn.pl>
2005-05-04 13:19 ` Thom Dyson <TDyson@sybex.com>
2005-05-04 13:19 Re: last value moalaniz@unsl.edu.ar
2005-05-05 04:37 Re: last value Ramakrishnan Muralidharan <ramakrishnanm@pervasive-postgres.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox