2 ################################################################################
5 # Description: This script will dump out the description for the ECR #(s)
7 # Author: Andrew@DeFaria.com
8 # Created: Fri Jan 7 15:35:13 PST 2005
11 # (c) Copyright 2005, LynxWorks Inc., all rights reserved
13 ################################################################################
20 # Called when a database error has occurred
23 my $statement = shift;
25 print $msg . "\nError #" . $DB->err . " " . $DB->errstr . "\n";
27 if (defined $statement) {
28 print "SQL Statement: $statement\n";
34 # Connect to database. Note this is using anonymous access (read only)
35 $DB = DBI->connect("DBI:Informix:lynxmigr1")
36 or DBError "Unable to open database";
38 # Loop through ECR #s from the command line
39 foreach my $ecr (@ARGV) {
40 print "ECR #: $ecr\n";
42 my $statement = "select description from defect where pkey=\"$ecr\"";
43 my $sth = $DB->prepare ($statement)
44 or DBError "Unable to prepare statement", $statement;
47 or DBError "Unable to execute statement", $statement;
49 # Defect records are unique per pkey (AKA ECR) there for there will
50 # only be one entry in @row. Also the description is returned as one
52 my @row = $sth->fetchrow_array;
55 # @row is empty if there was no ECR by that number
56 print "Nothing found!\n";
59 print "Description:\n" . "-" x 80 . "\n" . $desc . "\n" . "-" x 80 . "\n";