Subversion Repositories DevTools

Rev

Rev 2026 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
392 dpurdie 1
#! perl
2
########################################################################
5710 dpurdie 3
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
392 dpurdie 4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
10
# Description   : Deployment Manager play script
11
#
12
#
13
# Usage:
14
#
15
# Version   Who      Date        Description
16
#
17
#......................................................................#
18
 
19
require 5.006_001;
20
use strict;
21
use warnings;
22
use JatsError;
23
use DBI;
24
use JatsRmApi;
25
 
26
#use Data::Dumper;
27
use Cwd;
28
my $opt_verbose = 1;
29
my $RM_DB;
30
 
31
sub getPkgDetailsByRTAG_ID
32
{
33
    my ($RTAG_ID) =@_;
34
    my $foundDetails = 0;
35
    my (@row);
36
 
37
    # if we are not or cannot connect then return 0 as we have not found anything
38
    connectRM( \$RM_DB );
39
 
40
    # First get details from pv_id
41
 
42
#    my $bom_id = 10083;
43
#    my $node_id = 26718;
44
#    my $os_id = 27318;
45
 
46
my    $bom_id = 13543;
47
my    $os_id = 39544;
48
 
49
    my $m_sqlstr = "SELECT osc.*, pkg.pkg_name, pv.pkg_version, pd.IS_REJECTED, pv.IS_PATCH,pv.IS_OBSOLETE, pkg.pkg_id" .
50
                " FROM PACKAGES pkg, PACKAGE_VERSIONS pv,PRODUCT_DETAILS pd,".
51
	            "(" .
52
#		        " SELECT osc.seq_num, osc.prod_id, osc.product_comments, osc.change_log_flag, osc.is_node_spec".
53
		        " SELECT osc.seq_num, osc.prod_id".
54
		        " FROM os_contents osc".
55
		        " WHERE osc.os_id = $os_id" .
56
	            " ) osc" .
57
                " WHERE pd.PROD_ID (+)= pv.PV_ID" .
58
                "   AND pv.pkg_id = pkg.pkg_id" .
59
                "   AND osc.PROD_ID = pv.pv_id" .
60
#                "   AND pv.IS_PATCH =''" .
61
                " ORDER BY osc.SEQ_NUM desc" ;
62
 
63
    my $sth = $RM_DB->prepare($m_sqlstr);
64
    if ( defined($sth) )
65
    {
66
        if ( $sth->execute( ) )
67
        {
68
            print "--- Execute\n";
69
            if ( $sth->rows )
70
            {
71
                print "--- Execute ROWS\n";
72
                while ( @row = $sth->fetchrow_array )
73
                {
74
print "---- ".join (',',@row)."\n";
75
#                    my $idx = 0;
76
#                    foreach my $el ( @row )
77
#                    {
78
#                        $idx++;
79
#                        print "$idx :: $el\n";
80
#                    }
81
                }
82
            }
83
            print "--- Finish\n";
84
            $sth->finish();
85
        }
86
    }
87
    else
88
    {
89
        Error("Prepare failure" );
90
    }
91
}
92
 
93
#-------------------------------------------------------------------------------
94
# Function        : Main
95
#
96
# Description     :
97
#
98
# Inputs          :
99
#
100
# Returns         :
101
#
102
 
103
ErrorConfig( 'name'    =>'DM_PLAY01' );
104
 
105
getPkgDetailsByRTAG_ID(1861);               # Sydney Legacy
106
exit;
107
 
108
 
109