On Thu, 2002-11-14 at 03:40, Попов Андрей wrote:
> Hi.
> I have problem with Postgres.
> I have perl script, that add 2 records in 2 tables. This script I run
> from web throught web server Apache (on FreeBSD).
> (perl version 5.005)

You would be better off using the sequence rather than trying to fetch
out max(obj_id).


select currval('object_list_obj_id_seq') AS nextvalue;

after the insert into object_list.

> 
>     $sth = $dbh->prepare("select max(obj_id) from object_list");
>     $sth->execute();
>     $max = $sth->fetchrow;

-- 
Rod Taylor <[EMAIL PROTECTED]>

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
  • ... Попов Андрей
    • Rod Taylor

Reply via email to