NAME

DBIO::Oracle::Introspect::Views - Introspect the definitions of Oracle views

VERSION

version 0.900007

DESCRIPTION

Fetches the defining query of the views of a schema from all_views.text, the part of the model DBIO::Oracle::Diff::View compares and writes CREATE OR REPLACE VIEW from. The text is what Oracle stores, not what was written: see "DESCRIPTION" in DBIO::Oracle::Diff::View for what it rewrites.

text is a LONG column, so LongReadLen is raised to 16 MiB for the fetch (set before the statement is prepared, when DBD::Oracle sizes the buffer) and LongTruncOk is off: a definition that does not fit ends the fetch with an error instead of being cut. The setting of the handle is restored afterwards.

Views, their columns and the views they rest on are read in binary order by name (the columns by column_id), in every session language, not by the NLS_SORT of the session.

METHODS

fetch

my $views = DBIO::Oracle::Introspect::Views->fetch($dbh, $schema, $tables);

Given the tables hashref from DBIO::Oracle::Introspect::Tables, returns a hashref keyed by view name, for each table of kind view: { view_name => $name, definition => $text, columns => \@names, depends_on => \@views }. definition is undef when the server gives no text. columns lists the names of the columns of the view in COLUMN_ID order, as Oracle has them (from all_tab_columns): the text does not hold the names a column list CREATE VIEW v (a, b) AS ... gave, and the diff writes them back. depends_on lists the views the view rests on, from all_dependencies: a view of this schema by its bare name, one of another schema as owner.view.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.