Oracle/Introspect/Tables.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 21 / 21 CC 2 SCAR 4.1
CC
2
Cov
100%
fetch
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Oracle/Storage/Savepoints.pm ↑ Summary Shortcut/ora.pm »
1 package DBIO::Oracle::Introspect::Tables;
2 # ABSTRACT: Introspect Oracle tables and views
3  
4 27 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 27 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 27 our $VERSION = '0.900004';
8  
9  
10  
11 1 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=6.9
Pod documented
12 1 my ($class, $dbh, $schema) = @_;
13  
14 1 my %tables;
15  
16 # Fetch tables from all_tables (owned tables)
17 1 my $sth = $dbh->prepare(q{
18 SELECT table_name, 'table' AS kind
19 FROM all_tables
20 WHERE owner = ?
21 AND table_name NOT LIKE 'BIN$%'
22 AND table_name NOT LIKE 'DR$%'
23 UNION ALL
24 SELECT view_name, 'view' AS kind
25 FROM all_views
26 WHERE owner = ?
27 ORDER BY table_name
28 });
29 1 $sth->execute($schema, $schema);
30  
31 1 ▶ while (my $row = $sth->fetchrow_hashref('NAME_lc')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $row = $sth->fetchrow_hashref("NAME_lc")) 2 1 3
32 $tables{ $row->{table_name} } = {
33 table_name => $row->{table_name},
34 kind => $row->{kind},
35 2 schema => $schema,
36 };
37 }
38  
39 1 return \%tables;
40 }
41  
42 27 1;
43  
44 __END__
« Oracle/Storage/Savepoints.pm ↑ Summary Shortcut/ora.pm »