diff --git a/plugins/dbgate-plugin-oracle/src/backend/sql/matviews.js b/plugins/dbgate-plugin-oracle/src/backend/sql/matviews.js index 85c7f259..6504753d 100644 --- a/plugins/dbgate-plugin-oracle/src/backend/sql/matviews.js +++ b/plugins/dbgate-plugin-oracle/src/backend/sql/matviews.js @@ -1,15 +1,19 @@ module.exports = ` -select owner as schema_name, +SELECT owner as schema_name, mview_name pure_name, container_name, - query as definition, - ora_hash(query, 'MD5') as "hash_code" - --refresh_mode, - --refresh_method, - --build_mode, - --last_refresh_date, - --ompile_state -from all_mviews + '' || trim( + extractvalue( + dbms_xmlgen.getxmltype('SELECT query + FROM all_mviews + WHERE mview_name=''' || + MVIEW_NAME || ''' AND + owner = ''' || + owner || '''' + ), + '//text()' + )) definition +FROM all_mviews where mview_name=OBJECT_ID_CONDITION order by owner, mview_name -`; +`; \ No newline at end of file