line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::Dia::SQL::Output::Oracle; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Oracle.pm,v 1.2 2009/03/02 13:41:39 aff Exp $ |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=pod |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Parse::Dia::SQL::Output::Oracle - Create SQL for Oracle. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SEE ALSO |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Parse::Dia::SQL::Output |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
1831
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
49
|
|
18
|
2
|
|
|
2
|
|
5
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
29
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
6
|
use Data::Dumper; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
71
|
|
21
|
2
|
|
|
2
|
|
7
|
use File::Spec::Functions qw(catfile); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
92
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
6
|
use lib q{lib}; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
9
|
|
24
|
2
|
|
|
2
|
|
128
|
use base q{Parse::Dia::SQL::Output}; # extends |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
178
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
require Parse::Dia::SQL::Logger; |
27
|
|
|
|
|
|
|
require Parse::Dia::SQL::Const; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 new |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
The constructor. Arguments: |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
|
|
|
|
|
|
my ( $class, %param ) = @_; |
37
|
|
|
|
|
|
|
my $self = {}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Set defaults for oracle |
40
|
|
|
|
|
|
|
$param{db} = q{oracle}; |
41
|
|
|
|
|
|
|
$param{object_name_max_length} = $param{object_name_max_length} || 30; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self = $class->SUPER::new(%param); |
44
|
|
|
|
|
|
|
bless( $self, $class ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
return $self; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 _get_drop_index_sql |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Create drop index sql for given index. Discard tablename. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _get_drop_index_sql { |
56
|
|
|
|
|
|
|
my ( $self, $tablename, $indexname ) = @_; |
57
|
|
|
|
|
|
|
return qq{drop index $indexname cascade constraints} |
58
|
|
|
|
|
|
|
. $self->{end_of_statement} |
59
|
|
|
|
|
|
|
. $self->{newline}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |