develooper Front page | perl.beginners | Postings from January 2002

UNIQUE KEY

Thread Next
From:
Mark Martin
Date:
January 15, 2002 09:40
Subject:
UNIQUE KEY
Message ID:
3.0.1.32.20020115173018.012cb370@ailm.may.ie
Hi,
I'm trying to maintain a unique key in an Oracle Table while working on the
table using DBI. the unique key is just a no. read in from a txt file and
incremented for each record - supposedly. In fact I'm getting unique
constraint violation. Can anybody tell me what is wrong with this code,(the
statement handler inserts into the table)
cheers,
Mark

if (condition){
		open (IN,$uniquefile) or die "Cannot Open $uniquefile \n";
		$uniquemarker=<IN>;
		close(IN);
		$uniquemarker++;

		$sth1->execute($uniquemarker,$var1,$var2) or die "Can't execute SQL
statement: $DBI::errstr\n";					
		}

		open (OUT,">$uniquefile");
		print OUT "$uniquemarker";

$dbh1->disconnect();
exit;




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About