Skip to content

Commit

Permalink
Fix issue with database < 10g that do not have the DROPPED column int…
Browse files Browse the repository at this point in the history
…o the ALL_TABLES view. Thanks to Lance Jacob for the report.
  • Loading branch information
dalibot committed Jan 22, 2015
1 parent fd36e8b commit e81b5ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Ora2Pg.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6734,7 +6734,10 @@ sub _table_info
$sth->finish();

$sql = "SELECT A.OWNER,A.TABLE_NAME,NVL(num_rows,1) NUMBER_ROWS,A.TABLESPACE_NAME,A.NESTED,A.LOGGING FROM ALL_TABLES A, ALL_OBJECTS O WHERE A.OWNER=O.OWNER AND A.TABLE_NAME=O.OBJECT_NAME AND O.OBJECT_TYPE='TABLE' $owner";
$sql .= " AND A.TEMPORARY='N' AND (A.NESTED != 'YES' OR A.LOGGING != 'YES') AND (A.DROPPED IS NULL OR A.DROPPED = 'NO') AND A.SECONDARY = 'N'";
$sql .= " AND A.TEMPORARY='N' AND (A.NESTED != 'YES' OR A.LOGGING != 'YES') AND A.SECONDARY = 'N'";
if ($self->{db_version} =~ /Release [89]/) {
$sql .= " AND (A.DROPPED IS NULL OR A.DROPPED = 'NO')";
}
$sql .= " AND (A.OWNER, A.TABLE_NAME) NOT IN (SELECT OWNER, MVIEW_NAME FROM ALL_MVIEWS UNION ALL SELECT LOG_OWNER, LOG_TABLE FROM ALL_MVIEW_LOGS)";
$sql .= $self->limit_to_objects('TABLE', 'A.TABLE_NAME');
$sql .= " AND (A.IOT_TYPE IS NULL OR A.IOT_TYPE = 'IOT') ORDER BY A.OWNER, A.TABLE_NAME";
Expand Down

0 comments on commit e81b5ae

Please sign in to comment.