#!perl ################################################################## # getPhysicsTableTagFromTcl # ========================== # # Person Date Modifications # ---------------------------------------------------------------- # Dave Waters 22.12.2005 Original implementation. # ################################################################## use DBI; use strict; my $debug = 0; my $tcl_tag_number = $ARGV[0]; if ($debug) {print "input tcl_tag_number = $tcl_tag_number \n";} my $dbname = $ARGV[1]; if ($debug) {print "database name = $dbname \n";} my $user = $ARGV[2]; if ($debug) {print "username = $user \n";} my $password = $ARGV[3]; if ($debug) {print "password = $password \n";} # Connect to the trigger database : my ($dbh) = DBI->connect("dbi:Oracle:$dbname",$user,$password) || die "Error connecting $DBI::errstr\n"; my ($handle); # Prepare query : ($handle) = $dbh->prepare("select tcl_tag, physics_table_name, physics_table_tag, frozen_release, cvstag, checksum, filesize from l3_tcls where tcl_tag=$tcl_tag_number"); # Execute query : if ($DBI::err){print "$DBI::errstr\n";} $handle->execute(); if ($DBI::err){print "$DBI::errstr\n";} my @all_info; my $physics_table_name = ""; my $physics_table_tag = 0; while (@all_info = $handle->fetchrow) { $physics_table_name = ""; if ($all_info[1]) {$physics_table_name = $all_info[1];} $physics_table_tag = 0; if ($all_info[2]) {$physics_table_tag = $all_info[2];} } printf("%5i",$physics_table_tag); $dbh->disconnect;