Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000273.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: ecrdesc</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000272.html" title="Files4ecr" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000274.html" title="TOT Build succeeds" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000272.html">&laquo; Files4ecr</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000274.html">TOT Build succeeds &raquo;</a>
44                      </p>
45
46                      <a id="a000273"></a>
47                      <div class="entry" id="entry-273">
48                         <h3 class="entry-header">ecrdesc</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <p>Well I played around with this a little more and came up with a Perl script that will dump ECR descriptions fairly easy. From what I understand that's mostly what we want access to from a Linux box (though I could envision wanting other things perhaps in the future). The problem as I see it is that this script will only run on lynx12. It should be runnable from any machine really however you would need to install the DBD module for Informix for Perl access. Unfortunately this requires at least an Informix Client SDK and that's not free!  :-(</p>
52                            </div>
53                            <div id="more" class="entry-more">
54                               <p>Here's the simple script (currently at lynx12:/tmp/ecrdesc.pl):</p>
55
56 <div class="code"><pre>
57 #!/usr/bin/perl
58 ################################################################################
59 #
60 # File:         ecrdesc
61 # Description:  This script will dump out the description for the ECR #(s)
62 #               passed in.
63 # Author:       Andrew@DeFaria.com
64 # Created:      Fri Jan  7 15:35:13 PST 2005
65 # Language:     Perl
66 #
67 # (c) Copyright 2005, LynxWorks Inc., all rights reserved
68 #
69 ################################################################################
70 use strict;
71 use warnings;
72 use DBI;
73
74 my $DB;
75
76 # Called when a database error has occurred
77 sub DBError {
78   my $msg       = shift;
79   my $statement = shift;
80
81   print $msg . "\nError #" . $DB->err . " " . $DB->errstr . "\n";
82
83   if (defined $statement) {
84     print "SQL Statement: $statement\n";
85   } # if
86
87   exit $DB->err;
88 } # DBError
89
90 # Connect to database. Note this is using anonymous access (read only)
91 $DB = DBI->connect("DBI:Informix:lynxmigr1")
92   or DBError "Unable to open database";
93
94 # Loop through ECR #s from the command line
95 foreach my $ecr (@ARGV) {
96   print "ECR #: $ecr\n";
97
98   my $statement    = "select description from defect where pkey=\"$ecr\"";
99   my $sth    = $DB->prepare ($statement)
100     or DBError "Unable to prepare statement", $statement;
101
102   $sth->execute ()
103     or DBError "Unable to execute statement", $statement;
104
105   # Defect records are unique per pkey (AKA ECR) there for there will
106   # only be one entry in @row. Also the description is returned as one
107   # large string.
108   my @row = $sth->fetchrow_array;
109
110   if (!@row) {
111     # @row is empty if there was no ECR by that number
112     print "Nothing found!\n";
113   } else {
114     my $desc = pop @row;
115     print "Description:\n" . "-" x 80 . "\n" . $desc . "\n" . "-" x 80 . "\n";
116   } # if
117 } # foreach
118
119 $DB->disconnect;
120
121 exit;
122 </pre></div>
123                            </div>
124                         </div>
125                         <p class="entry-footer">
126                            <span class="post-footers">Posted by  on January  7, 2005  4:03 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000273.html">Permalink</a>
127                         </p>
128                      </div>
129
130                      
131
132                      
133                   </div>
134                </div>
135             </div>
136          </div>
137       </div>
138    </div>
139 </body>
140 </html>