For Programmers: Free Programming Magazines  


Home > Archive > PERL POE > June 2005 > How to get LaDBI inserted ID?(postgre)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to get LaDBI inserted ID?(postgre)
Laura

2005-06-09, 4:00 am

Hi

Simple example: I need to save Forums and topics. At first
i save all the forums, I need it`s ID`s to insert it to
topics table.

Structure:
-table1: forums
--id
--name

-table: topics
--id
--forum_id
--name

So after insert into forums table i need it`s inserted ID
immediately. I can`t use 'select id from forums order by
id desc limit 1' after insert because program goes in
multiple sessions. So, how could it do it?

I have an idea to store and increment ID`s inside the
program, but maybe it`s more simple?

Thank you very much!
---
Professional hosting for everyone - http://www.host.ru
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com