line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::Plugin::DateFormat::Oracle; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
27550
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
118
|
|
6
|
1
|
|
|
1
|
|
5
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1
|
|
|
1
|
|
11
|
my $class = shift; |
12
|
1
|
|
|
|
|
2
|
my $pkg = caller(0); |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
210
|
|
15
|
1
|
|
|
|
|
7
|
*{"$pkg\::set_nls_date_format"} = sub { |
16
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
17
|
0
|
|
|
|
|
0
|
my $format = shift; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
eval { |
20
|
0
|
|
|
|
|
0
|
$pkg->db_Main->do(qq[ALTER SESSION SET NLS_DATE_FORMAT = '$format']); |
21
|
|
|
|
|
|
|
}; |
22
|
0
|
0
|
|
|
|
0
|
$self->_croak("ALTER SESSION ERROR ".$@ ) if $@; |
23
|
1
|
|
|
|
|
5
|
}; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
12
|
*{"$pkg\::get_nls_date_format"} = sub { |
26
|
0
|
|
|
0
|
|
|
my $self = shift; |
27
|
0
|
|
|
|
|
|
my $date_format; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$self->set_sql(nls_date_format => q[SELECT VALUE FROM v$nls_parameters WHERE PARAMETER = 'NLS_DATE_FORMAT']); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
eval { |
32
|
0
|
|
|
|
|
|
$date_format = $self->search_nls_date_format->first->{value}; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
$self->_croak("SELECT NLS_DATE_FORMAT ERROR ".$@ ) if $@; |
36
|
0
|
|
|
|
|
|
return $date_format; |
37
|
|
|
|
|
|
|
} |
38
|
1
|
|
|
|
|
3
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |