line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::Dia::SQL::Output::Sybase; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Sybase.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::Sybase - Create SQL for Sybase. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SEE ALSO |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Parse::Dia::SQL::Output |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
2136
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
53
|
|
18
|
2
|
|
|
2
|
|
4
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
26
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
5
|
use Data::Dumper; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
69
|
|
21
|
2
|
|
|
2
|
|
9
|
use File::Spec::Functions qw(catfile); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
80
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
7
|
use lib q{lib}; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
9
|
|
24
|
2
|
|
|
2
|
|
134
|
use base q{Parse::Dia::SQL::Output}; # extends |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
151
|
|
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 sybase |
40
|
|
|
|
|
|
|
$param{db} = q{sybase}; |
41
|
|
|
|
|
|
|
$param{object_name_max_length} = $param{object_name_max_length} || 30; |
42
|
|
|
|
|
|
|
$param{end_of_statement} = $param{end_of_statement} || "\ngo"; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$self = $class->SUPER::new(%param); |
45
|
|
|
|
|
|
|
bless( $self, $class ); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$self->{log}->warn(qq{Using object_name_max_length }. $param{object_name_max_length}); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 _get_drop_index_sql |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
create drop index for index on table with given name. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _get_drop_index_sql { |
59
|
|
|
|
|
|
|
my ( $self, $tablename, $indexname ) = @_; |
60
|
|
|
|
|
|
|
return qq{drop index $tablename.$indexname} |
61
|
|
|
|
|
|
|
. $self->{end_of_statement} |
62
|
|
|
|
|
|
|
. $self->{newline}; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |