From 486eafa454ebd65721bc32f94c4d1fcce98d3b76 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 26 Oct 2007 02:51:13 +0000 Subject: [PATCH] more portable "next record id" code git-svn-id: svn://svn.open-ils.org/ILS/trunk@7935 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/import/marc2bre.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/extras/import/marc2bre.pl b/Open-ILS/src/extras/import/marc2bre.pl index 07e5822dc2..7f8323de60 100755 --- a/Open-ILS/src/extras/import/marc2bre.pl +++ b/Open-ILS/src/extras/import/marc2bre.pl @@ -69,8 +69,12 @@ my %processing_cache; my $dsn = "dbi:$db_driver:host=$db_host;dbname=$db_name"; if (!$recid) { + my $table = 'biblio_record_entry'; + $table = 'biblio.record_entry' if ($db_driver eq 'Pg'); + my $dbh = DBI->connect($dsn,$db_user,$db_pw); - my $sth = $dbh->prepare("SELECT nextval('biblio.record_entry_id_seq')"); + my $sth = $dbh->prepare("SELECT MAX(id) + 1 FROM $table"); + $sth->execute; $sth->bind_col(1, \$recid); $sth->fetch; -- 2.11.0